Skip to content

Schema with object in object #40

Description

@charliefancelli

Hi,

Is it possible to describe a schema with an object in a object ?
The idea is to describe an object button with its own properties and using this object in many other objects like in this example :

"schema": {
	"button": {
		"type": "object",
		"legend": "Bouton",
		"properties": {
			"title": {
			  "title": "Text in the button",
			  "type": "string"
			},
			"link": {
			  "title": "Link of the button",
			  "type": "string",
			},
			"type": {
			  "title": "Type of link",
			  "type": "string",
			  "enum": ["_self", "_blank"]
			}
		}
	},
	"sectionTitle": {
 		"type": "object",
		"properties": {
			"title": {
			  "title": "Titre",
			  "description": "",
			  "type": "string"
			},
			"button": {
				"type": "button"
			}
		}
	},
	"myItem": {
		"type": "object",
		"properties": {
			"other": {
			  "title": "Other object",
			  "description": "",
			  "type": "string"
			},
			"button": {
				"type": "button"
			}
		}
   	}
...

Thanks,

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions