jsonform / jsonform

Build forms from JSON Schema. Easily template-able. Compatible with Bootstrap 3 out of the box.
https://jsonform.github.io/jsonform/playground/index.html
MIT License
2.72k stars 553 forks source link

Error: JSONForm does not yet support schemas that use the $ref keyword. See: #54" #441

Open PengZhao-GitHub opened 4 months ago

PengZhao-GitHub commented 4 months ago

https://ulion.github.io/jsonform/playground/

JSON Schema - Inline $ref to definitions is supported in the playground above,

but when I use the example.html and give a schema with inline $ref, I get error as

"The JSON Form library returned: Error: JSONForm does not yet support schemas that use the $ref keyword. See: https://github.com/joshfire/jsonform/issues/54"

Any idea? thanks!

PengZhao-GitHub commented 4 months ago

Here is the JSON Schema - Inline $ref to definitions. It works well in the playground, but get error in the current master version.

{
  "schema": {
    "properties": {
      "animal": {
        "$ref": "#/definitions/animation"
      }
    },
    "definitions": {
      "animation": {
        "type": "object",
        "properties": {
          "duration": {
            "title": "Duration",
            "type": "integer"
          },
          "stepper": {
            "title": "Stepper",
            "type": "string"
          },
          "then": {
            "title": "Then",
            "type": "array",
            "maxItems": 1,
            "items": {
              "$ref": "#/definitions/animation"
            },
            "default": []
          }
        }
      }
    }
  }
}

edited: added code block for readability

sdetweil commented 4 months ago

this is a bug in playground.. $ref is not currently supported