Comments (5)
Should the event be raised only after 'the change in model is validated against the schema' ?
from yang-js.
To be honest, I wasn't really sure what the behavior for missing leafref should be. Because it is a relational dependency, it may be valid at the time it's being set but it CAN also become invalid if the data it's pointing at changes. So I opted to compute it at the Getter side instead of the Setter side. Which basically means that it currently accepts an invalid/missing leafref while you're setting it (since it may become valid at a future time when the referencing leaf can be resolved).
What I can do is to have it trigger an error - but still accept the data? Not too sure yet on the best approach for this...
from yang-js.
The missing leafref is reported perfectly fine as seen above. I am not sure whether an 'CU' event must be raised on such things. Every subscription will then need to parse such errors on every event raised and that too for every field in the schema, which is not so good.
How does the system reject an invalid model when I do not pass any value for 'mandatory true' attributes ? Does that as well raise an event so that the model subscriber receives it?
from yang-js.
Well, the CU events are raised because the input configuration was not rejected during Setter (despite the fact that missing leafref does make that configuration invalid). Basically we are implicitly treating it as a pseudo-valid configuration. I can also consider having it enforce during Setter so the data itself is rejected?
Except for the leafref case, all other constraint validations take effect during Setter - which means that an error will be thrown and no CUD events will be triggered.
from yang-js.
Latest yang-js handles leafref resolution during Setter and will reject invalid value appropriately and not raise any CU events. Closing issue.
from yang-js.
Related Issues (20)
- [Question] Validate XML data against Yang model. HOT 1
- Yang.compose() results in container undefined as root container for every input. HOT 2
- Unable to build:web HOT 3
- Update documentation using ES6 syntax HOT 1
- [Question] Working with Multiple Schemas HOT 1
- yang extension field compilation error HOT 2
- Improve Yang.import to support directory search and extension order
- validation of Read-only data HOT 2
- Validation errors should show "path" to failure and/or name of failing portion. HOT 2
- Mandatory Fields in Read Only Data HOT 1
- Not working on Windows platform? HOT 2
- Schema extension does not work as described in the TUTORIAL.md HOT 2
- Unable to import ietf-ip.yang HOT 2
- Unable to import ietf-netconf-monitoring.yang
- Unable to import o-ran-compression-factors.yang HOT 3
- MaxListenersExceededWarning: Possible EventEmitter memory leak detected.
- Issue with importing Yang file with Extensions HOT 1
- when parse the file '[email protected]' with yang-js, there is 'unable to locate' error HOT 1
- is this plan supportting RFC 7950?
- Error happened during using yang-js in browser
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yang-js.