Skip to content

Update OpenAPI generator to include parameter- and property-level availability #4356

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

Open
lcawl opened this issue May 6, 2025 · 0 comments

Comments

@lcawl
Copy link
Contributor

lcawl commented May 6, 2025

priority: high
effort: low?

🚀 Feature Proposal

Some specifications include @availability details at the API, parameter, and property level. However only the operation-level information is currently included in the OpenAPI documents. The generator should be updated to put that information into the x-state at all levels.

Motivation

Since we are currently publishing only the "current" release of the API docs for each major version, it's useful to show as much info as possible about when parameters and properties were added/deprecated/discontinued etc.

I did a quick test to verify that if the x-state information exists at the parameter level, it will be displayed in Bump.sh:

Image

Example

For example in
https://github.com/elastic/elasticsearch-specification/blob/main/specification/_global/field_caps/FieldCapabilitiesRequest.ts
it has @availability details at the operation-level:

...
 * @rest_spec_name field_caps
 * @availability stack since=5.4.0 stability=stable
 * @availability serverless stability=stable visibility=public
...

... as well as at the parameter level:

...
    /**
     * A comma-separated list of filters to apply to the response.
     * @availability stack since=8.2.0
     * @availability serverless
     */
    filters?: string

In the generated OpenAPI files the details appear at the operation-level:

    "/_field_caps": {
      "get": {
...
        "x-state": "Added in 5.4.0"
      },

... but are missing from the parameter level:

      "field_caps-filters": {
        "in": "query",
        "name": "filters",
        "description": "A comma-separated list of filters to apply to the response.",
        "deprecated": false,
        "schema": {
          "type": "string"
        },
        "style": "form"
      },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant