Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make the no-invalid-media-type-examples rule fail gracefully when the example is not resolved from a ref #1906

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

tatomyr
Copy link
Contributor

@tatomyr tatomyr commented Feb 13, 2025

What/Why/How?

Fixed an issue where the no-invalid-media-type-examples rule crashed instead of reporting an error when it failed to resolve an example from a $ref.

Reference

Fixes #1905

Testing

Screenshots (optional)

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

Copy link

changeset-bot bot commented Feb 13, 2025

🦋 Changeset detected

Latest commit: 989b86e

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

This PR includes changesets to release 2 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli 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 marked this pull request as ready for review February 13, 2025 17:00
@tatomyr tatomyr requested review from a team as code owners February 13, 2025 17:00
Copy link
Contributor

github-actions bot commented Feb 13, 2025

Command Mean [ms] Min [ms] Max [ms] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 949.7 ± 14.5 934.5 987.9 1.00 ± 0.02
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 945.3 ± 9.3 934.1 963.2 1.00

Copy link
Contributor

github-actions bot commented Feb 13, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.54% 5062/6445
🟡 Branches 67.24% 2065/3071
🟡 Functions 73.2% 836/1142
🟡 Lines 78.82% 4775/6058

Test suite run success

840 tests passing in 121 suites.

Report generated by 🧪jest coverage report action from 989b86e

@tatomyr tatomyr requested a review from Marshevskyy February 13, 2025 19:28
@tatomyr tatomyr force-pushed the fix/no-invalid-media-type-examples-crashing branch from 03484db to 989b86e Compare February 14, 2025 09:17
@Marshevskyy Marshevskyy merged commit dbe1011 into main Feb 14, 2025
41 checks passed
@Marshevskyy Marshevskyy deleted the fix/no-invalid-media-type-examples-crashing branch February 14, 2025 09:27
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.

Unresolvable refs in examples crash with "Cannot read properties of undefined (reading 'value')"
3 participants