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
952 stars 227 forks source link

Failed to dereference schema #264

Closed KirillSerogodsky closed 2 years ago

KirillSerogodsky commented 2 years ago
{
  "openrpc": "1.2.6",
  "info": {},
  "servers": [],
  "methods": [
    {
      "name": "test",
      "params": [
        {
          "name": "test",
          "schema": {
            "$ref": "#/components/schemas/Array"
          }
        }
      ],
      "result": {
        "name": "data",
        "schema": {
          "$ref": "#/components/schemas/Array",
          "items": {
            "$ref": "#/components/schemas/Number"
          }
        }
      }
    }
  ],
  "components": {
    "contentDescriptors": {},
    "schemas": {
      "Array": {
        "type": "array"
      },
      "Number": {
        "type": "number"
      }
    }
  }
}

Result: Screenshot 2022-05-27 at 14 18 06 $ref is not parsed.

philsturgeon commented 2 years ago

Hi Krill.

openrpc is not supported and there's not enough information in this issue to actually do anything about it anyway.

If you can dig in and send a PR with any relevant fixes that would be awesome.

Best of luck.