Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested json rendering #128

Open
ctippur opened this issue May 31, 2018 · 0 comments
Open

Nested json rendering #128

ctippur opened this issue May 31, 2018 · 0 comments

Comments

@ctippur
Copy link

ctippur commented May 31, 2018

I have a dynamically generated nested json that needs to be rendered as form.
For certain edge cases, I get an error:

jsonform.js:3170 Uncaught Error: The JSONForm contains an element that links to an element in the JSON schema (key: "statements") and that should not based on its type ("none")

I have checked the code and I seem to have followed the convention. Wondering what could be wrong.

{
	"statement_ids": {
		"items": {
			"title": "items",
			"type": "string"
		},
		"title": "statement_ids",
		"type": "array"
	},
	"statements": {
		"items": {
			"properties": {
				"Action": {
					"anyOf": [{
						"type": "string"
					}, {
						"type": "array"
					}],
					"title": "Action",
					"type": "string"
				},
				"Condition": {
					"title": "Condition",
					"type": "object"
				},
				"Effect": {
					"enum": ["Allow", "Deny"],
					"title": "Effect",
					"type": "string"
				},
				"NotAction": {
					"anyOf": [{
						"type": "string"
					}, {
						"type": "array"
					}],
					"title": "NotAction",
					"type": "string"
				},
				"NotPrincipal": {
					"anyOf": [{
						"type": "object"
					}, {
						"type": "array"
					}],
					"title": "NotPrincipal",
					"type": "string"
				},
				"NotResource": {
					"anyOf": [{
						"type": "string"
					}, {
						"type": "array"
					}],
					"title": "NotResource",
					"type": "string"
				},
				"Principal": {
					"anyOf": [{
						"type": "string"
					}, {
						"type": "object"
					}, {
						"type": "array"
					}],
					"title": "Principal",
					"type": "string"
				},
				"Resource": {
					"anyOf": [{
						"type": "string"
					}, {
						"type": "array"
					}],
					"title": "Resource",
					"type": "string"
				},
				"Sid": {
					"title": "Sid",
					"type": "string"
				},
				"title": "properties",
				"type": "string"
			},
			"required": ["Effect"],
			"title": "items",
			"type": "object"
		},
		"title": "statements",
		"type": "array"
	},
	"type": {
		"enum": ["has-statement"],
		"title": "type",
		"type": "string"
	}
}

I would also like to propose a enhancement to include anyOf types for validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant