ci: add OpenAPI spec lint gate - #296
Merged
Merged
Conversation
Add scripts/lint_openapi.py and a GitHub Actions check that runs it on every PR touching api-reference/*.json. The linter fails on: - schema properties without a description (request and response side, recursively, including array items and allOf members) - integer time fields whose description lacks Unix/epoch/timestamp wording (the SDK generator maps types from description text) - string enums whose values are not all named and explained in the property description - operations without a request or 200-response example Also unify the ErrorResponse.request_id description across the module specs — five branches each wrote a slightly different wording.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
scripts/lint_openapi.py(stdlib-only) and a GitHub Actions check that runs it on every PR touchingapi-reference/*.json.Rules enforced:
binding:tags and historically shipped undocumenteda_update,work/off/sleep, …) forced readers to guessWell-known value sets (severity levels,
enabled/disabled,success/failed) andorderbyfield-name enums are exempt; the legacy Apifox export is excluded.Also unifies the
ErrorResponse.request_iddescription across module specs (five concurrent branches each wrote a different wording).Verification
python3 scripts/lint_openapi.py→OK: 12 spec files, no violationson current main content.