brutusin / brutusin/json-forms

Nested json rendering

Open
#128 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
618
Forks
171
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.