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

MissingPointerError: Token "smartylighting" does not exist. #243

Closed KhudaDad414 closed 8 months ago

KhudaDad414 commented 3 years ago

Assume I have this JSON schema:

channels:
  'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured':
    description: The topic on which measured values may be produced and consumed.
    parameters:
      streetlightId:
        description: The ID of the streetlight.
        schema:
          type: string

now if I try to parse the parameters using $refs.get('#/channels/smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured/parameters') I will get the above error. Is there a way to handle cases that token(path) itself contains '/' ?

jonluca commented 8 months ago

Thanks for the bug report and apologies on the delay. This has been fixed in the latest version

jonluca commented 8 months ago

https://github.com/APIDevTools/json-schema-ref-parser/commit/8a42204d8aa0959a5a4fa3cac70ca82def8634a0