Skip to content

Generate a docs for properties that are a simple reference #5129

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
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

swallez
Copy link
Member

@swallez swallez commented Aug 12, 2025

Open API 3.0 doesn't allow attaching docs and additional properties to a $ref type definition. Because of this (and this was a forgotten TODO) many property descriptions were dropped in the OpenAPI output.

This PR fixes this by using a common/recommended workaround consisting in using a single allOf inline schema around the reference.

Fixes #5082.

@szabosteve can you verify that the doc generation pipeline correctly picks up this change?

Example (taken from the diff):

"chunking_settings": {
    "$ref": "#/components/schemas/inference._types.InferenceChunkingSettings"
}

Becomes:

"chunking_settings": {
    "externalDocs": {
      "url": "https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config"
    },
    "description": "The chunking configuration object.",
    "allOf": [
     {
        "$ref": "#/components/schemas/inference._types.InferenceChunkingSettings"
      }
    ]
}

Copy link
Contributor

Following you can find the validation changes against the target branch for the APIs.

No changes detected.

You can validate these APIs yourself by using the make validate target.

@szabosteve
Copy link
Contributor

Thank you so much for this fix, @swallez! I asked the folks responsible for the docs generation process to verify if they can pick this change up correctly. I'll get back to you as soon as I have an answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[OpenAPI] Parameter descriptions are missing from the generated OpenAPI file while present in the ts files
2 participants