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

Doesn't support remote schema in $ref #4

Open
francbartoli opened this issue Oct 22, 2023 · 0 comments · May be fixed by #6
Open

Doesn't support remote schema in $ref #4

francbartoli opened this issue Oct 22, 2023 · 0 comments · May be fixed by #6

Comments

@francbartoli
Copy link

def resolve_schema(self, schema_ref):
        schema_name = schema_ref.split('/')[-1]
        schema = self.spec['components']['schemas'][schema_name]
        ...

If schema_ref is a remote URI the following error is returned:

Traceback (most recent call last):
  ...
  File "/Users/francbartoli/code/fastgeoapi/.venv/lib/python3.11/site-packages/fencer/cli.py", line 34, in run
    api_spec.load_endpoints()
  File "/Users/francbartoli/code/fastgeoapi/.venv/lib/python3.11/site-packages/fencer/api_spec.py", line 255, in load_endpoints
    body=self.resolve_body(self.paths[path][method].get('requestBody')),
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/francbartoli/code/fastgeoapi/.venv/lib/python3.11/site-packages/fencer/api_spec.py", line 273, in resolve_body
    schema = self.resolve_schema(body['content']['application/json']['schema']['$ref'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/francbartoli/code/fastgeoapi/.venv/lib/python3.11/site-packages/fencer/api_spec.py", line 293, in resolve_schema
    schema = self.spec['components']['schemas'][schema_name]
             ^^^^
KeyError: 'execute.yaml'
@francbartoli francbartoli linked a pull request Apr 13, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant