Skip to content

Automatically check for OpenAPI errors #4368

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 9, 2025 · 0 comments
Open

Automatically check for OpenAPI errors #4368

lcawl opened this issue May 9, 2025 · 0 comments

Comments

@lcawl
Copy link
Contributor

lcawl commented May 9, 2025

Request

Integrate OpenAPI checks into the validation of pull requests.

Motivation

The make lint-docs command is currently not part of any automation or validation so it is very easy for a pull request to unwittingly create invalid OpenAPI documents.

It's currently also possible to have pull requests that make changes in the specification but do not re-generate OpenAPI documents. The changes are therefore not caught until the next time the make transform-to-openapi command is run. Ideally this would occur within each PR so that contributors would immediately see the changed output and the linting results.

Additional info

Per https://docs.bump.sh/help/continuous-integration/#api-diff--validation-of-the-documentation-file it seems that the Bump.sh diff feature might provide some validation. We have more control over the linting rules used by the make-lint-docs command, however. Currently a lot of the linting rules are set to "warning" instead of "error" status to give us more time to take action on them: https://github.com/elastic/elasticsearch-specification/blob/main/docs/linters/redocly.yaml

There are also some warnings that are unlikely to ever be addressed, such as those described in #2806. We might want to exclude entirely from our linting rules if they're causing too much noise. Conversely there are rules related to missing descriptions that we'll likely want to turn into errors after we clean up all the pre-existing absences.

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