Comments (7)
@mrproper This thing has come up before and to fix it here in python i would have to hack inside pyyaml when using that within this lib to somehow hijack the data loading process or some other hook and then use that as a validator for the unique field. Because of this complexity do not expect this to be fixed any time soon. The only way this would be fixed right now is if someone else would submit a patch to pykwalify to implement this, otherwise this is very low down on my priority list.
This might not even be possible with pyyaml depending on how the internals work when it encounters the case above.
from pykwalify.
cool, thanks for the update, i expected as much but i thought id get it on here to at least track it at some point =)
Though i didnt think pykwalify was using pyaml, according to the front page:
"In release 1.6.0 PyYaml will be deprecated in favor of ruamel.yaml"
from pykwalify.
@mrproper When something is deprecated it is usually on the way out from the code but it is still in there for compatibility and support for a few versions until people have had enough time to switch over. It is not so good practise to just rip something that deep inside the core out just like that.
Ruamel.yaml have the same problem as i mentioned above. But with ruamel i have not yet looked at the code and if it would be possible to highjack the dict key loading code and make it compatible with the unique feature. The situation might be better but i can't promise anything.
from pykwalify.
@mrproper A update to this problem is that i might go back on the decision to remove pyyaml in next release as pyyaml have done a release a while back. It might just be that i will change the default yaml parser to ruamel yaml as it appears to be more active then pyyaml but both will still be supported in the code depending on what your needs are.
from pykwalify.
@mrproper I will close this issue as invalid becuase i see no way that i will be able to support this feature. As mentioned above this is a issue in pyyaml or ruamel yaml and it is not something that easily supported.
I do not really know how kwalify does this but if i would guess (without looking in the source code) i would guess that they might do a textual processing of the yaml files but this is not something that is good to do or even possible to support when you do the validation on data structures. There is no real case where you can have the exact same key twice in a python dict so this issue will not be possible to run anyway.
from pykwalify.
No worries @Grokzen, i included it because users/developers etc writing yaml have more than once on occasion added duplicate keys to a dict =), thanks for the communications though!
from pykwalify.
@mrproper Ye i can understand why this would be a issue if you yourself have no control over the supplied data.
from pykwalify.
Related Issues (20)
- Union of schemas HOT 4
- 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.