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

[BUG] One component $ref referring to another does not work #126

Closed
6 tasks
spacether opened this issue Jan 16, 2023 · 2 comments · Fixed by #125
Closed
6 tasks

[BUG] One component $ref referring to another does not work #126

spacether opened this issue Jan 16, 2023 · 2 comments · Fixed by #125
Labels
bug Something isn't working

Comments

@spacether
Copy link
Contributor

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request
Description

One component $refing another does not work

openapi-json-schema-generator version
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
@spacether spacether linked a pull request Jan 16, 2023 that will close this issue
3 tasks
@spacether
Copy link
Contributor Author

spacether commented Jan 16, 2023

The linked PR generates ref definitions at all json paths and includes example in a client sample spec where one component $refs another component.

@spacether spacether changed the title [BUG] One component $refing another does not work [BUG] One component $ref referring to another does not work Jan 16, 2023
@spacether spacether added the bug Something isn't working label Jan 16, 2023
@spacether
Copy link
Contributor Author

this it is working in the v2.0.0 release of openapi-json-schema-generator.
That is where further development is being done on the python generator.
Here is the definition of the component schema RefPet

    RefPet:
      $ref: '#/components/schemas/Pet'

And here is the generated class

from petstore_api.components.schema import pet
RefPet = pet.Pet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant