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: fix $ref resolution when used with $id #1286

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RomanHotsiy
Copy link
Member

What/Why/How?

Potential fix for #1233

I'll fill in more details later.

Reference

#1233

Testing

Screenshots (optional)

Check yourself

  • Code is linted
  • Tested with redoc/reference-docs/workflows (internal)
  • All new/updated code is covered with tests

Security

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

@RomanHotsiy RomanHotsiy requested a review from a team as a code owner October 5, 2023 09:34
@changeset-bot
Copy link

changeset-bot bot commented Oct 5, 2023

⚠️ No Changeset found

Latest commit: 85f12c9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Command Mean [s] Min [s] Max [s] Relative
redocly lint packages/core/src/benchmark/benches/rebilly.yaml 1.326 ± 0.014 1.314 1.352 1.00
redocly-next lint packages/core/src/benchmark/benches/rebilly.yaml 1.334 ± 0.029 1.299 1.392 1.01 ± 0.02

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 75.96% 4007/5275
🟡 Branches 65.97% 2140/3244
🟡 Functions 67.92% 648/954
🟡 Lines 76.16% 3756/4932

Test suite run success

638 tests passing in 93 suites.

Report generated by 🧪jest coverage report action from 85f12c9

@jeremyfiel
Copy link
Contributor

jeremyfiel commented Oct 5, 2023

Hi Roman

i pulled down your branch and added the file I used in the original issue. It's not working correctly and it appears a new error is reported with userData as an unused component. It seems to have resolved the userData schema, but it's not recognizing it as a used component in the main OAS description. The original error remains with Challenge and File unresolved and never used. Both of those components are inside the userData schema and should resolve inside the external schema.

From the fix/dollar-id-support branch

validating fcc-classroom-userdata-openapi.json...
fcc-classroom-userdata-openapi.json:
  253:42  error    no-unresolved-refs    Can't resolve $ref
  205:70  error    no-unresolved-refs    Can't resolve $ref
  227:21  warning  no-unused-components  Component: "Challenge" is never used.
  259:21  warning  no-unused-components  Component: "File" is never used.

https://api.freecodecamp.org/classroom/userData:
  153:13  warning  no-unused-components  Component: "userData" is never used.

fcc-classroom-userdata-openapi.json: validated in 101ms

❌ Validation failed with 2 errors and 3 warnings.

this is from the main branch 1.2.0

validating C:/Users/fiel/downloads/fcc-classroom-userdata-openapi.json...
..\downloads\fcc-classroom-userdata-openapi.json:
  251:46  error    no-unresolved-refs    Can't resolve $ref
  203:74  error    no-unresolved-refs    Can't resolve $ref
  225:25  warning  no-unused-components  Component: "Challenge" is never used.
  257:25  warning  no-unused-components  Component: "File" is never used.

@RomanHotsiy
Copy link
Member Author

@jeremyfiel thanks for testing it. I suspected that 20min was not enough to fix this issue properly 😢
I'll take another try but not sure when.

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.

None yet

2 participants