redocly-cli icon indicating copy to clipboard operation
redocly-cli copied to clipboard

fix: $anchors in openapi documents are not properly parsed

Open tatomyr opened this issue 3 years ago • 1 comments

What/Why/How?

Closes https://github.com/Redocly/redocly-cli/issues/462

In order to not fail when bundling, $anchors need to be resolved correctly. I decided to collect all $anchors into anchorRefsMap while walking a document.

Reference

JSON Schema documentation on $anchor More on $anchor

Testing

Screenshots (optional)

Check yourself

  • [x] Code is linted
  • [x] Tested with redoc/reference-docs/workflows
  • [x] All new/updated code is covered with tests

Security

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

tatomyr avatar Aug 30 '22 12:08 tatomyr

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟡 Statements 73.54% 3324/4520
🟡 Branches 64.93% 1866/2874
🟡 Functions 66.08% 563/852
🟡 Lines 73.55% 3089/4200

Test suite run success

510 tests passing in 84 suites.

Report generated by 🧪jest coverage report action from 35108a9ae11aef26ee9f9f2f6f2a88164bcb296d

github-actions[bot] avatar Aug 30 '22 12:08 github-actions[bot]