Skip to content

openapi/lint: upgrade Spectral to 6.17.1 for OpenAPI 3.2 support - #453

Merged
akira28 merged 2 commits into
mainfrom
chore/spectral-6.17.1
Nov 16, 2026
Merged

akira28 merged 2 commits into
mainfrom
chore/spectral-6.17.1

Conversation

@akira28

@akira28 akira28 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR upgrades the Spectral toolchain in openapi/lint from 6.16.3 to 6.17.1, the latest release, so the action can lint OpenAPI 3.2 specs.

  • Spectral: @stoplight/spectral-cli moves to 6.17.1. The lockfile is regenerated, so @stoplight/spectral-rulesets moves from 1.22.6 to 1.23.1. That package holds the OpenAPI 3.2 schema (stoplightio/spectral#3033). Bumping only the CLI would leave the old rulesets package in the lockfile.
  • Node.js: Spectral 6.17 requires Node.js ^22.0 || >= 24.0, so the action now sets up Node.js 26, the current LTS, instead of Node.js 20. The action installs its own Node.js, so callers don't need to change anything.
  • Text: the action description, README and ruleset comment now list OpenAPI 3.2.
  • Tests: two new fixtures are added to test-openapi-lint:
    • valid-3.2.yaml uses 3.2 fields: tag summary, parent and kind, server name, response summary, and itemSchema for an NDJSON response.
    • schema-violation-3.2.yaml has a non-string tag parent, which the 3.2 schema rejects.

Why

The OpenAPI RFCs in elastic/docs-eng-team#1198 propose publishing every spec as OAS 3.2. With 6.16.3, Spectral checks a 3.2 document against the 3.1 schema, so valid-3.2.yaml gets 8 false oas3-schema errors, for example Property "summary" is not expected to be here on tags.

Testing

  • CI, on Node.js 26: all 19 checks pass, including every test-openapi-lint fixture.

I also ran the ruleset locally with both Spectral versions, on Node.js 24:

  • Fixtures: every fixture gets the result the matrix expects. valid-3.2.yaml passes with fail-on-warn, and schema-violation-3.2.yaml fails with "parent" property must be string.
  • Real specs, 6.16.3 compared with 6.17.1: the results are identical, by rule and by severity.
Spec Findings (both versions)
elasticsearch-openapi.json 1,231 warnings, 0 errors
elasticsearch-serverless-openapi.json 709 warnings, 0 errors
kibana.yaml 31 warnings, 0 errors

npm audit reports 0 vulnerabilities.

🤖 Generated with Claude Code

Bump @stoplight/spectral-cli from 6.16.3 to 6.17.1 and regenerate the
lockfile, so @stoplight/spectral-rulesets moves to 1.23.1 with the
OpenAPI 3.2 schema. Spectral 6.17 requires Node.js 22, so the action
now sets up Node.js 22.

Add valid and schema-violation OpenAPI 3.2 fixtures to the test matrix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@akira28
akira28 requested a review from a team as a code owner November 16, 2026 12:26
@akira28
akira28 requested a review from technige November 16, 2026 12:26
@akira28 akira28 added the enhancement New feature or request label Nov 16, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@akira28
akira28 merged commit 94009ff into main Nov 16, 2026
19 checks passed
@akira28
akira28 deleted the chore/spectral-6.17.1 branch November 16, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants