Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validating schema fails on recursion openapi 3.0.3 #124

Open
leonpros opened this issue Jan 25, 2022 · 4 comments
Open

Validating schema fails on recursion openapi 3.0.3 #124

leonpros opened this issue Jan 25, 2022 · 4 comments

Comments

@leonpros
Copy link

Expected Behavior

Validation of yaml/json file should be ok.

Minimal Example Spec

Example of yaml that fails to validate:

File:
type: object
properties:
absoluteFile:
$ref: '#/components/schemas/File'
absolutePath:
type: string
canonicalFile:
$ref: '#/components/schemas/File'
file:
type: boolean

Actual Behavior

prance validate .\Tests_API\openapi.yaml

ERROR in ".\Tests_API\openapi.yaml" [ResolutionError]: Recursion reached limit of 1 trying to resolve "file:///C:/Tests_API/openapi.json#/components/schemas/File"!
file:///C:/Tests_API/openapi.json#/components/schemas/File
file:///C:/Tests_API/openapi.json#/components/schemas/File

Steps to Reproduce

Environment

  • OS: Win 10
  • Python version: 3.8.5
  • Swagger/OpenAPI version used: 3.0.3
  • Backend: (flex, swagger-spec-validator or openapi-spec-validator)
@s3rgeym
Copy link

s3rgeym commented Apr 2, 2022

how to fix this shit?

@leonpros
Copy link
Author

leonpros commented Feb 13, 2023

how to fix this shit?

I would suggest using the --no-resolve flag if you are trying to use command line:
prance validate --backend=openapi-spec-validator --no-resolve openapi

In robot framework, I tried using recursion_limit=100, but it still fails.
Tried adding the specific endpoints to ignore ignored_endpoints=..., but i guess i don't know the syntax either.

@chineseluo
Copy link

+1

@Archelyst
Copy link

If you are using the Pytohn API you can provide a recursion_limit_handler which will be called when recursion is detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants