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 for fragments of external docs #49

Open
mbklein opened this issue Sep 3, 2024 · 0 comments
Open

Support for fragments of external docs #49

mbklein opened this issue Sep 3, 2024 · 0 comments

Comments

@mbklein
Copy link

mbklein commented Sep 3, 2024

This is valid in OpenAPI v3:

paths:
  /collections:
    get:
      operationId: getCollections
      tags:
        - Collection
      parameters:
        - $ref: "./types.yaml#/components/parameters/as"
        - $ref: "./types.yaml#/components/parameters/page"
        - $ref: "./types.yaml#/components/parameters/size"
        - $ref: "./types.yaml#/components/parameters/sort"
      responses:
        200:
          $ref: "./types.yaml#/components/responses/SearchResponse"

But it looks like the ref handler is set up to handle two cases:

  • $ref: "path/to/file.yaml" (where the external ref is the entire external file)
  • $ref: "#/internal/ref" (where the ref is internal to the current file)

It needs a third case:

  • $ref: "path/to/file.yaml#/ref/within/external/file" (where it loads and processes the external file, and then returns the subset indicated by the fragment)
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

1 participant