Closed Rajkapoor1 closed 5 years ago
Can you try to add "required": ["stringExample"]
Hi, I tried by adding required in below schema but still, it shows checkboxes. schema = { type : 'object', title: 'schema generator', description: 'dfdfd', properties: { stringExample : { type: 'string', title: 'A string example', description: 'a string description', default: 'a default string example', minLength: 15, maxLength: 20, propertyOrder: 1 }, stringExample1 : { type: 'string', title: 'Name', description: 'Name', default: 'danial', minLength: 15, maxLength: 20, propertyOrder: 2 }, required: ['stringExample'] } }; not sure what I'm missing here.
above is output which shows 'not exists' checkboxes.
{
"type": "object",
"title": "schema generator",
"description": "dfdfd",
"properties": {
"stringExample": {
"type": "string",
"title": "A string example",
"description": "a string description",
"default": "a default string example",
"minLength": 15,
"maxLength": 20,
"propertyOrder": 1
},
"stringExample1": {
"type": "string",
"title": "Name",
"description": "Name",
"default": "danial",
"minLength": 15,
"maxLength": 20,
"propertyOrder": 2
}
},
"required": [
"stringExample"
]
}
Thanks a lot, it works. is there any way to set the text to the button which expand/collapse the elements? button which shows in above, below 'schema generator' text.?
It seems you set icon="fontawesome4"
, but didn't load font awesome 4.
Or just remove icon
property, its optional.
Thanks a lot, it works.
Version(if relevant): 1.0.0
Environment(if relevant):
I'm using angular verrsion 8.0.0
Code(if relevant):
<json-editor [schema]="schema" [initialValue]="value"
in appcomponent.ts file, I have defined schema object as below schema = { type : 'object', title: 'schema generator', description: 'dfdfd', properties: { stringExample : { type: 'string', title: 'A string example', description: 'a string description', default: 'a default string example', minLength: 15, maxLength: 20, propertyOrder: 1 }, stringExample1 : { type: 'string', title: 'Name', description: 'Name', default: 'Rajesh', minLength: 15, maxLength: 20, propertyOrder: 2 } } };