chore: add linting for dataValue in example#2945
Conversation
🦋 Changeset detectedLatest commit: 5a2caee The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Performance Benchmark (Lower is Faster)
|
|
📦 A new experimental 🧪 version v0.0.0-snapshot.1783680915 of Redocly CLI has been published for testing. Install with NPM: npm install @redocly/cli@0.0.0-snapshot.1783680915 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5ba3d83. Configure here.

What/Why/How?
OpenAPI 3.2 introduced
dataValueas the schema-checked example field, but the linter never validated it, so invaliddataValueexamples passed silently. This adds linting fordataValueagainst its schema, matching howvalueis linted.Reference
Comment in the issue #919
Testing
Tests passed successfully on monorepo.
Screenshots (optional)
Check yourself
Security
Note
Low Risk
Targeted lint extension reusing existing validation; legacy
valuebehavior is preserved and coverage is broad in tests.Overview
Extends no-invalid-parameter-examples and no-invalid-media-type-examples so OpenAPI 3.2 Example objects are checked on
dataValuethe same wayvaluealready was, closing a gap where invalid structured examples could pass lint.A shared
getExampleValueToValidatehelper picksdataValuewhen present, otherwisevalue, and both rules route that payload through existing AJV validation. Diagnostics now anchor under the chosen field (e.g..../examples/foo/dataValue/name), including for$ref-resolved component examples;serializedValueis not used for schema checks.Docs for both rules add OAS 3.2
dataValuesections; a minor @redocly/openapi-core changeset and new unit/e2e coverage document refs, booleans, binary media, and backward-compatiblevalueon 3.2.Reviewed by Cursor Bugbot for commit 5a2caee. Bugbot is set up for automated code reviews on this repo. Configure here.