json-schema-form/angular-schema-form

What's wrong with schema and layout?

person2713 opened this issue · 5 comments

`{
  "schema": {
  "type": "object",
  "properties": {
    "name": {
		"type": "string"
    },
	"Objects": {
	 "type": "array",
	  "items": {
		"type": "object",
		"properties": {
		  "object": {
			"type": "object",
			"properties": {
			  "objectId": {
				"type": "string"
			  },
			  "attributes": {
				"type": "array",
				"items": {
				  "type": "object",
				  "properties": {
					"attributeId": {
						"type": "string"
					},
					"attrbuteName": {
						"type": "string"
					},
					"value": {
					  "type": "string"
					}
				  }
				}
			  }
			}
		  }
		}
	  }
	}
  }
},
  "form": [
      "name",
      {
          "key" :"Objects",
          "items": [
              {
                "key":"Objects[].object",
                "items": [
                    "objectId",
                    {
                        "key": "attributes",
                        "items": [
                            "['attributes'][]attributeId",
                            "['attributes'][]attrbuteName",
                            "['attributes'][]value"
                        ]
                    }
                ]
              }
            ]
      }
]
}`

Why I don't see "attributeId", "attrbuteName" and "value"?

This is probably an issue best handled by a question on stackoverflow.com. Your syntax is off. In short, you need to use the full key like Objects[].object.attributes[].attributeId

You are right, thanks. Can you give me links on documentation, please? Can you give me links on doc, please?

In general, my purpose is add appear Name of object when user input objectId. May be there is a better idea than add "attrbuteName" to schema and then customize it in layout?
Sample:
image

Thanks @scottux

@person2713 please comment if you want to re-open or do not feel the question has been answered sufficiently.