Comments (4)
Wait... just so i get this right. Do you want the schema to do a Deep merge between two different schemas into one single schema inside the lib itself and then do the merged validation on the data part? So in your example, the merged schema would be this?
type: map
mapping:
level1:
required: True
type: map
mapping:
level2a:
type: str
level2b:
type: str
from pykwalify.
That would be the idea. I could do it upstream in my code and submit only the "merged" schema to PyKwalify, but it seemed like a feature that would sit better in PyKwalify (being reusable by other have a similar use case) than in my package where it would be harder to reuse in other projects.
from pykwalify.
@christian-oreilly I and strongly leaning towards not supporting this feature mainly due to the reason that if i make some kind of schema union feature, i would have to take a strong stance on several different cases in how the union works with deep and nested data structures. And i am not willing to go down that route and define a certain method or rule set for how it would work inside the pykwalify core. I have in the past been thinking about the same kind of issue and same as then, i passed on it as it would just lead to more code to maintain and probably so many more config and tweak options down the line that i am just not willing to support in the end and would probably casue more harm or issues then what it is worth for me.
Basically what i am saying, is that it is not up to pykwalify to define how a schema union would work out, that Must be solved by the person that uses this tool. You have to provide a fully done schema to pykwalify and i will not change this behaviour.
If you are using this code as a lib inside your own application, then it should not be difficult to merge them before you send them into the Core class here.
from pykwalify.
Sure, no problem. I'll implement it on my side, Thanks for the fast feedback.
from pykwalify.
Related Issues (20)
- rule.py is missing a comma in defined_keywords list
- Deprecation warning due to invalid escape sequences in Python 3.8 HOT 1
- Fails to regex match a mapping with integer keys HOT 1
- AttributeError: 'int' object has no attribute 'startswith'
- Support multiple data type HOT 1
- New release? Maintainers needed or? HOT 2
- Deprecation warning "the imp module is deprecated in favour of importlib" HOT 1
- pattern rule not working with all scalar types HOT 1
- <RuleError: error code 4
- Using fulmatch for regex matching. HOT 1
- Schema Validation Against Multiple Files HOT 1
- Outputting Scan Results in SARIF Format HOT 1
- How can I check key only? HOT 5
- anchors to inherit properties are falsely reported as Duplicate HOT 2
- ReadTheDocs does not seem to be updating
- Some error message for length violations are wrong
- issue while using "unique: true" for the sequence data type HOT 3
- Tests fail with ruamel.yaml 0.18.0
- Core Validation Fails - Multi Threading & Python 3.11 HOT 1
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 pykwalify.