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

Support external $refs in openapi schema #11

Open
markfejes opened this issue Apr 9, 2022 · 0 comments · May be fixed by #12
Open

Support external $refs in openapi schema #11

markfejes opened this issue Apr 9, 2022 · 0 comments · May be fixed by #12

Comments

@markfejes
Copy link

In larger projects the openapi schema file is usually divided to more parts, but currently it's not handled in this package, which casues an ajv compilation error if there is any external $ref.

main.yml

components:
  schemas:
    UserList:
      type: array
      items:
        $ref: './user.yaml#/definitions/User'

user.yml

definitions:
  User:
    type: object
    properties:
      id:
        type: string
      name:
        type: string
    required: ['id']

Currently the external refs are not handled in @openapi-contrib/openapi-schema-to-json-schema https://github.com/openapi-contrib/openapi-schema-to-json-schema#features

NOTE: $refs are not handled in any way, so please use a resolver such as json-ref-resolver prior to using this package.

I've created a pull request which uses @apidevtools/json-schema-ref-parser to process external $refs.

@markfejes markfejes changed the title Support externel $refs in openapi schema Support external $refs in openapi schema Apr 9, 2022
@markfejes markfejes linked a pull request Apr 9, 2022 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