redocly-cli-cookbook
redocly-cli-cookbook copied to clipboard
feat: add custom refs plugin rules: no-refs-siblings and no-circular-refs
Created two rules in the scope of investigating issues https://github.com/Redocly/redocly-cli/issues/1329 and https://github.com/Redocly/redoc/issues/2474. Also related: https://github.com/Redocly/redocly-cli/issues/644
I tried to test this and it didn't do what I expected. Did I find an edge case, or do I not understand what a circular reference is? My (I edited the components/schema section of the Museum API example example snippet is like this:
TicketConfirmation:
description: Unique confirmation code used to verify ticket purchase.
$ref: '/#components/schemas/BuyMuseumTicketsResponse'
BuyMuseumTicketsResponse:
description: Details for a museum ticket after a successful purchase.
type: object
properties:
confirmationCode:
$ref: '#/components/schemas/TicketConfirmation'
required:
- confirmationCode
@lornajane there's a typo in '/#components/schemas/BuyMuseumTicketsResponse'. It should be the other way around: #/.... Anyway, it isn't get checked, so it looks like some kind of an edge case. Thanks for the catch! Will try to fix that a bit later.
(I converted it to a draft because I come to check this PR every week and forget it is still in progress. 🧠 )