-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
Expected Behaviour
When flex is installed, it should not be the default unless the input document is swagger.
Minimal Example Spec
n/a
Actual Behaviour
When flex is installed, prance validate my_openapi3.yaml will emit
prance validate my_openapi3.yaml
Processing "my_openapi3.yaml"...
-> Resolving external references.
ERROR in "my_openapi3.yaml" [ValidationError]: ErrorDict(<class 'flex.exceptions.ErrorList'>, {'required': [ErrorDict(<class 'flex.exceptions.ErrorList'>, {'swagger': ['This value is required']})]})
The {'swagger': ['This value is required']} in there is reasonably informative if you know/remember what flex is looking for.
But it isnt a great UX for people using openapi3, which is going to be an increasing percentage of users as openapi v3 replaces swagger.
The easiest approach is to re-organise the imports in
prance/prance/util/__init__.py
Line 31 in bab4b38
| def validation_backends(): |
openapi_spec_validator is first, and IMO flex should be last it has seen releases recently at https://pypi.org/project/flex/, while swagger_spec_validator is better maintained.
If there is some backwards compatibility reason for keeping flex first, it should be possible for it to only be first if the context is a swagger input.
Steps to Reproduce
- Install flex
- Run
prance validate any_openapi3_schema.yaml
Environment
- OS: Linux
- Python version: 3.10
- Swagger/OpenAPI version used: 3.0
- Backend: flex
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels