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

Error in response_schema_conformance after update from 1.2.0 to 1.3.2 #539

Closed
stepanbokoc opened this issue Apr 29, 2020 · 4 comments · Fixed by #553
Closed

Error in response_schema_conformance after update from 1.2.0 to 1.3.2 #539

stepanbokoc opened this issue Apr 29, 2020 · 4 comments · Fixed by #553
Assignees
Labels
Priority: High Important but not urgent Type: Bug Errors or unexpected behavior

Comments

@stepanbokoc
Copy link

stepanbokoc commented Apr 29, 2020

Hi,
In my schema I have paths and schemas in their own files under folder ./paths and ./schemas.

After update to 1.3.2 I started getting this exception
jsonschema.exceptions.RefResolutionError: <urlopen error [Errno 2] No such file or directory: '/home/sb/work/python/sraps/docs/application/openapi.yml'>

actual path is
/home/sb/work/python/sraps/docs/application/openapi/openapi.yml

example of paths file

description: Desc
get:
  responses:
    200:
      description: description
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: "../openapi.yml#/components/schemas/User"

The problem here is with ../. It looks for "../openapi.yml#/components/schemas/User" from base directory (/home/sb/work/python/sraps/docs/application/openapi/) and not from ./paths (/home/sb/work/python/sraps/docs/application/openapi/paths/)

@Stranger6667 Stranger6667 self-assigned this Apr 29, 2020
@Stranger6667 Stranger6667 added Priority: High Important but not urgent Type: Bug Errors or unexpected behavior labels Apr 29, 2020
@Stranger6667
Copy link
Member

Hi!

Thank you for reporting this. The bug is connected with the recent changes in response_schema_conformance check - now it uses a not-resolved schema. I will investigate

@Stranger6667
Copy link
Member

Ok, I added one more bug there - _get_response_schema now accepts not resolved schema, and it is not resolved inside. After adding resolving, it fails with an error :/ I will work on a fix

@Stranger6667
Copy link
Member

@stepanbokoc

The fix is released in 1.4.0

Let me know if it works for your case

@stepanbokoc
Copy link
Author

Yes it works now, thank you sir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High Important but not urgent Type: Bug Errors or unexpected behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants