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: do not fail when bundling a description containing null in examples #1792

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

tatomyr
Copy link
Contributor

@tatomyr tatomyr commented Oct 31, 2024

What/Why/How?

Fixed API descriptions bundling. Previously, schemas containing nulls in examples were causing failures.

Reference

The original bug was introduced here.

Testing

Discovered the bug while testing the OpenAPI VSCode extension:

        openapi: 3.1.0
        paths: 
          /:
            get: 
              responses: 
                200:
                  content: 
                    application/json: 
                      examples: 
                        Foo:   # <-- if fails when trying to resolve externalValues here

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

@tatomyr tatomyr requested review from a team as code owners October 31, 2024 14:16
@tatomyr tatomyr self-assigned this Oct 31, 2024
Copy link

changeset-bot bot commented Oct 31, 2024

🦋 Changeset detected

Latest commit: cac939f

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

Copy link
Contributor

Command Mean [ms] Min [ms] Max [ms] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 963.7 ± 20.5 944.7 1016.3 1.00
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 967.9 ± 26.2 947.1 1027.7 1.00 ± 0.03

Copy link
Contributor

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.83% 5016/6363
🟡 Branches 67.53% 2076/3074
🟡 Functions 73.32% 830/1132
🟡 Lines 79.14% 4734/5982

Test suite run success

812 tests passing in 121 suites.

Report generated by 🧪jest coverage report action from cac939f

@Marshevskyy Marshevskyy merged commit ebbcddc into main Oct 31, 2024
40 checks passed
@Marshevskyy Marshevskyy deleted the fix/bundle-failing-on-null-examples branch October 31, 2024 16:05
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.

4 participants