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

Doesn't support refs within the same document #178

Closed rocifier closed 4 years ago

rocifier commented 4 years ago

This cannot be dereferenced, but is valid json-schema:

{
  "action":{
    "type":"object",
    "id":"CodeDescription",
    "properties":{
      "code":{
        "type":"string"
      },
      "description":{
        "type":"string"
      }
    }
  },
  "requestReason":{
    "type":"object",
    "$ref":"CodeDescription"
  }
}

Was discovered as an issue from this library https://github.com/bcherny/json-schema-to-typescript/issues/303

rocifier commented 4 years ago

Closed, as this was a schema generated in draft 3 which is old. The library is working with 6/7.