Skip to content

fix: validate nullable oas3 example correctly#1980

Merged
tatomyr merged 2 commits intomainfrom
fix/nullable-example-validation
Mar 4, 2025
Merged

fix: validate nullable oas3 example correctly#1980
tatomyr merged 2 commits intomainfrom
fix/nullable-example-validation

Conversation

@tatomyr
Copy link
Collaborator

@tatomyr tatomyr commented Mar 4, 2025

What/Why/How?

Fixed the no-invalid-schema-examples rule validating nullable OpenAPI 3.0 schemas incorrectly.
Added the check for null example in nullable schemas (only valid for OAS3).

Reference

Related issue: Redocly/redocly-vs-code#42

Testing

Tested in VS Code extension as well.

Check yourself

  • Code changed? - Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests
  • New package installed? - Tested in different environments (browser/node)

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2025

🦋 Changeset detected

Latest commit: a1d3bcc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli Patch
@redocly/respect-core Patch

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

@tatomyr tatomyr requested a review from RomanHotsiy March 4, 2025 09:38
@tatomyr tatomyr marked this pull request as ready for review March 4, 2025 09:38
@tatomyr tatomyr requested review from a team as code owners March 4, 2025 09:38
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2025

Command Mean [ms] Min [ms] Max [ms] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 960.3 ± 30.8 930.1 1033.8 1.00 ± 0.04
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 959.2 ± 28.7 931.3 1025.2 1.00

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 79.39% 7034/8860
🟡 Branches 68.4% 2933/4288
🟡 Functions 75.08% 1148/1529
🟡 Lines 79.77% 6708/8409

Test suite run success

1339 tests passing in 193 suites.

Report generated by 🧪jest coverage report action from a1d3bcc

Co-authored-by: Jacek Łękawa <164185257+JLekawa@users.noreply.github.com>
@tatomyr tatomyr requested a review from JLekawa March 4, 2025 12:31
@tatomyr tatomyr merged commit 1c7a270 into main Mar 4, 2025
41 checks passed
@tatomyr tatomyr deleted the fix/nullable-example-validation branch March 4, 2025 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants