APIDevTools / json-schema-ref-parser

Parse, Resolve, and Dereference JSON Schema $ref pointers in Node and browsers
https://apitools.dev/json-schema-ref-parser
MIT License
957 stars 228 forks source link

Add support for $anchor #222

Closed lordpixel23 closed 3 years ago

lordpixel23 commented 3 years ago

JSON Schema now includes a mechanism to simplify references as described in Section 9.2 of 2020-12 draft.

https://json-schema.org/draft/2020-12/json-schema-core.html#rfc.section.9.2

Basically defining named anchors and referring to them rather than using JSON pointer.

Currently this does not work, returning (in Swagger CLI at least) printing Invalid $ref pointer "fn". Pointers must begin with "#/"

philsturgeon commented 3 years ago

Thanks for the heads up. This is all covered in https://github.com/APIDevTools/json-schema-ref-parser/issues/145 and will be the basis of an already started rewrite!