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

Response type for "/doc/openapi.yaml" #175

Open
pvdbosch opened this issue Feb 27, 2024 · 2 comments
Open

Response type for "/doc/openapi.yaml" #175

pvdbosch opened this issue Feb 27, 2024 · 2 comments

Comments

@pvdbosch
Copy link
Contributor

When documenting the "GET /doc/openapi.yaml" operation in OpenAPI, as in [doc-refdata], max compatibility with tooling is achieved when specifying the payload as binary:

    OpenApiResponse:
      description: OpenAPI document describing this API
      content:
        application/yaml:
          schema:
            type: string
            format: binary

Non-binary payload type: object has undefined behavior for YAML content-type. Binary format is also the only one allowed currently by the validator.

Can we document this payload format in the guide and add it to openapi-common? I often see problems with it in OpenAPIs (wrong media type or other schema).

Also, we could modify the [doc-refdata] rule to prefer publishing as YAML (SHOULD) over JSON (OPTIONAL), conform to [oas-yaml].

@jpraet
Copy link
Contributor

jpraet commented Feb 27, 2024

Is "/doc/openapi.yaml" supposed to be defined in the OpenAPI definition? See #127

How do you handle serving referenced files like /doc/belgif/common/v1/common-v1.yaml? Or do you provide a fat yaml?

@pvdbosch
Copy link
Contributor Author

Good question. We're currently doing this, as fat yaml, because otherwise the API Gateway blocks the request.

For documentation purpose, its self-referential so leads to chicken-or-egg problem. Maybe useful when client developers have another, possibly different, version of the OpenAPI document and want to check the current version on the server.
However, in case of secured APIs, they're probably missing an access token to retrieve it...

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

2 participants