ecoutu / eco-json-schema-form

Polymer 1.0 json schema form builder
http://ecoutu.github.io/eco-json-schema-form
MIT License
10 stars 10 forks source link

draft 07 JSON schema support #3

Open ghost opened 5 years ago

ghost commented 5 years ago

I noticed that the form for nested items is not generated properly (if properties attribute is not used for the nested elements), e.g. nested fields are not rendered for the following schema which is taken from https://json-schema.org/learn/miscellaneous-examples.html.

{
  "$id": "https://example.com/arrays.schema.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "description": "A representation of a person, company, organization, or place",
  "type": "object",
  "properties": {
    "fruits": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "vegetables": {
      "type": "array",
      "items": { "$ref": "#/definitions/veggie" }
    }
  },
  "definitions": {
    "veggie": {
      "type": "object",
      "required": [ "veggieName", "veggieLike" ],
      "properties": {
        "veggieName": {
          "type": "string",
          "description": "The name of the vegetable."
        },
        "veggieLike": {
          "type": "boolean",
          "description": "Do I like this vegetable?"
        }
      }
    }
  }
}

See screenshot:

Screen Shot 2019-08-06 at 4 13 19 PM