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: clean up the discriminator mapping in the remove-x-internal decorator #1694

Merged
merged 4 commits into from
Oct 28, 2024

Conversation

tatomyr
Copy link
Contributor

@tatomyr tatomyr commented Aug 29, 2024

What/Why/How?

Fixed the remove-x-internal decorator, which was not removing the reference in the corresponding discriminator mapping while removing the original $ref.

Reference

Fixes #1649

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

@tatomyr tatomyr self-assigned this Aug 29, 2024
@tatomyr tatomyr requested review from a team as code owners August 29, 2024 08:02
Copy link

changeset-bot bot commented Aug 29, 2024

🦋 Changeset detected

Latest commit: ec94fa8

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

github-actions bot commented Aug 29, 2024

Command Mean [s] Min [s] Max [s] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 1.003 ± 0.021 0.980 1.037 1.00
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 1.013 ± 0.015 0.989 1.046 1.01 ± 0.03

Copy link
Contributor

github-actions bot commented Aug 29, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.81% 5011/6358
🟡 Branches 67.52% 2075/3073
🟡 Functions 73.3% 829/1131
🟡 Lines 79.12% 4729/5977

Test suite run success

811 tests passing in 121 suites.

Report generated by 🧪jest coverage report action from ec94fa8

@tatomyr tatomyr changed the title fix: remove the discriminator mapping in the remove-x-internal decorator fix: clean up the discriminator mapping in the remove-x-internal decorator Aug 29, 2024
@tatomyr tatomyr force-pushed the fix/remove-x-internal-discriminator-mapping branch from 9afd155 to 20f7448 Compare August 29, 2024 12:44
@tatomyr tatomyr force-pushed the fix/remove-x-internal-discriminator-mapping branch from d9c04a6 to b7b20da Compare September 16, 2024 13:10
if (resolved.node?.[hiddenTag]) {
if (resolved.node?.[internalFlagProperty]) {
// First, remove the reference in the discriminator mapping, if it exists:
if (parent.discriminator?.mapping) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add extra check for typeof object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added here.

@tatomyr tatomyr force-pushed the fix/remove-x-internal-discriminator-mapping branch 3 times, most recently from 88384ae to f3e9762 Compare October 21, 2024 14:33
@tatomyr tatomyr force-pushed the fix/remove-x-internal-discriminator-mapping branch from f3e9762 to ec94fa8 Compare October 28, 2024 13:48
@Marshevskyy Marshevskyy merged commit ca08c1b into main Oct 28, 2024
41 checks passed
@Marshevskyy Marshevskyy deleted the fix/remove-x-internal-discriminator-mapping branch October 28, 2024 15:01
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.

Remove all usages of component marked x-internal
4 participants