prance
prance copied to clipboard
ImportError: cannot import name 'validate_v2_spec' from 'openapi_spec_validator'
Expected Behaviour
Import works
Minimal Example Spec
- Install prance and run a validation
- Install openapi_spec_validator 0.5.0
Actual Behaviour
cannot import name 'validate_v2_spec' from 'openapi_spec_validator'
It looks like the usage changed in openapi-spec-validator
0.5.0
.
# Before
from openapi_spec_validator import validate_v2_spec
validate_v2_spec(spec)
# After
from openapi_spec_validator import validate_spec, openapi_v2_spec_validator
validate_spec(spec, validator=openapi_v2_spec_validator)
Pinning openapi-spec-validator
to 0.4
fixed the issue for me!
Hi, is there any update on this?
The related packages openapi-core / openapi-spec-validator and openapi-schema-validator were updated the past few months to add support for OAS v3.1. The breaking changes are unfortunate, but updating prance to work with openapi_spec_validator 0.5 is probably a bit step towards OAS 3.1 support.
@RonnyPfannschmidt if you have some time, a release would be great 😄