Comments (4)
Thanks!
Actually, that's not precisely bug - unfortunately, I might say. I've come across this before, and you may come across this when using AWS in particular.
The thing is, OpenAPI specs are a little vague in some edge cases, and this is one of them.
OpenAPI specs generally provide examples as YAML files, but crucially include the mandate that specs must validate given an appropriate JSON schema. Which means the YAML you can use must be the subset of YAML that also works in JSON. And JSON does not allow any keys that are not strings (YAML allows any object, though the notation for that is horrendous).
So for a strict validation, an integer 200
must raise an error.
I have wondered about a lenient mode to prance that would stringify keys before trying to validate, but I'm not sure that might not have unintended side effects. Would that be helpful, or are you happy to change to string "200"
instead?
from prance.
Mind you, the location of that error might be weird. I'm going to look into it one way or another :)
from prance.
No, the error location is exactly what I suspected: the JSON validator requires string keys and finds non-string keys.
I've added a non-strict mode as outlined that stringifies keys. I hope that's in your interest :)
from prance.
Fixed in v0.6.0
from prance.
Related Issues (20)
- Tests failed when flex is installed HOT 1
- Support `writeOnly` properties
- Translating Parser handles non-schema references incorrectly
- Validating schema fails on recursion openapi 3.0.3 HOT 2
- parsing subset of api spec HOT 1
- DeprecationWarning on distutils
- Add test support for linux aarch64 HOT 1
- Dependency conflict when including prance HOT 1
- ImportError: cannot import name 'validate_v2_spec' from 'openapi_spec_validator' HOT 5
- Detect swagger vs openapi and auto-select appropriate backend
- validate doesnt indicate which line number or element is problematic
- merge allOf HOT 1
- Requesting a new release tag for the change - update openapi-spec-validator NixOS/nixpkgs#193272 HOT 2
- HOMEDRIVE in the fs.py file causes an error HOT 1
- support chardet v5
- support packaging v23 HOT 2
- CLI option does not allow click 8.x (which conflicts with black requirements)
- pypi lists previous release as latest HOT 4
- prance.convert uses a conversion API that was shut down
- Keep schema name after resolving HOT 2
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 prance.