You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{'description': 'successful response', 'content': {'application/json': {'schema': {'$ref': 'definitions/couriers/get.yml#/responses/GetResponse', 'x-scope': ['file:///data/swagger.yml']}}}} is not valid under any of the given schemas
Failed validating 'oneOf' in schema['properties']['paths']['patternProperties']['^\\/']['patternProperties']['^(get|put|post|delete|options|head|patch|trace)$']['properties']['responses']['patternProperties']['^[1-5](?:\\d{2}|XX)$']:
{'oneOf': [{'$ref': '#/definitions/Response'},
{'$ref': '#/definitions/Reference'}]}
On instance['paths']['/couriers/{courierIdentifier}']['get']['responses']['200']:
{'content': {'application/json': {'schema': {'$ref': 'definitions/couriers/get.yml#/responses/GetResponse',
'x-scope': ['file:///data/swagger.yml']}}},
'description': 'successful response'}
But if I remove $ref parameter in schema description or change it to type: string it works fine.
/become:
get:
operationId: become_user
parameters:
- description: Numeric identifier of the user to turn into.
explode: false
in: query
name: id
required: false
schema:
type: string
style: simple
Error:
connexion.exceptions.InvalidSpecification: {'description': 'Numeric identifier of the user to turn into.', 'explode': False, 'in': 'query', 'name': 'id', 'required': False, 'schema': {'type': 'string'}, 'style': 'simple'} is not valid under any of the given schemas
Failed validating 'oneOf' in schema['properties']['paths']['patternProperties']['^\\/']['patternProperties']['^(get|put|post|delete|options|head|patch|trace)$']['properties']['parameters']['items']:
{'oneOf': [{'$ref': '#/definitions/Parameter'},
{'$ref': '#/definitions/Reference'}]}
On instance['paths']['/become']['get']['parameters'][0]:
{'description': 'Numeric identifier of the user to turn into.',
'explode': False,
'in': 'query',
'name': 'id',
'required': False,
'schema': {'type': 'string'},
'style': 'simple'}
Reacted by Lou Marvin Caraig, Akbar Abdrakhmanov, Artem Manchenkov, Brian Kinney and koziez
You're probably getting stuck on #126 - The easiest workaround is to make a very basic '#/components/schemas/simple and point all your refs to that; then it'll validate all your other schemata and tell you where the error is.
Activity
vmarkovtsev commentedon Feb 26, 2021
This happens to me, too.
Error:
briankinney commentedon Mar 1, 2021
I have this issue as well. For now I have added
openapi-spec-validator<0.3in my project'srequirements.txtto avoid this issue.Altreus commentedon May 19, 2021
You're probably getting stuck on #126 - The easiest workaround is to make a very basic
'#/components/schemas/simpleand point all your refs to that; then it'll validate all your other schemata and tell you where the error is.MRigal commentedon Jun 21, 2021
Also pinning down the package here... :-/
JulienPalard commentedon Sep 2, 2021
Does #129 helps?
It can be tried temporarily using: