Skip to content

ci: add OpenAPI spec lint gate - #296

Merged
ysyneu merged 1 commit into
mainfrom
ci/openapi-lint-gate
Aug 20, 2026
Merged

ci: add OpenAPI spec lint gate#296
ysyneu merged 1 commit into
mainfrom
ci/openapi-lint-gate

Conversation

@ysyneu

@ysyneu ysyneu commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What

Adds scripts/lint_openapi.py (stdlib-only) and a GitHub Actions check that runs it on every PR touching api-reference/*.json.

Rules enforced:

Rule Why
every schema property has a description response structs have no binding: tags and historically shipped undocumented
integer time fields mention Unix/epoch/timestamp the go-flashduty SDK maps types from description text
every string enum value is named in the description undocumented enum values (a_update, work/off/sleep, …) forced readers to guess
operations carry request + 200 examples drives Try-It and snippet previews

Well-known value sets (severity levels, enabled/disabled, success/failed) and orderby field-name enums are exempt; the legacy Apifox export is excluded.

Also unifies the ErrorResponse.request_id description across module specs (five concurrent branches each wrote a different wording).

Verification

python3 scripts/lint_openapi.pyOK: 12 spec files, no violations on current main content.

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.
@ysyneu
ysyneu merged commit 835faec into main Aug 20, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant