react-json-schema-proptypes icon indicating copy to clipboard operation
react-json-schema-proptypes copied to clipboard

Nested schema support

Open Reggino opened this issue 7 years ago • 0 comments

Thank you for this, this is awesome.

I ran into an issue using nested schema's. E.g. i'm using the following schemas:

 "Invoice": {
      "type": "object",
      "properties": {
        "invoiceDate": {
          "type": "string",
          "format": "date"
        },
        "lines": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InvoiceLine"
          }
        },
...
      }
    }

    "InvoiceLine": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string"
        },
      },
...
    },

I'm using AJV myself in this application and have configured it with all schema's in my app. Would it be possible to 'inject' this preconfigured instance of AJV to support these kind of schema's?

When using Invoice as propType the application currently breaks, because it doesn't 'know' all required schemas.

Reggino avatar Apr 19 '17 09:04 Reggino