File tree Expand file tree Collapse file tree 4 files changed +100
-1
lines changed Expand file tree Collapse file tree 4 files changed +100
-1
lines changed Original file line number Diff line number Diff line change 1+ import { registerExamples } from './register' ;
2+
3+ export const schema = {
4+ type : 'object' ,
5+ properties : {
6+ value : {
7+ oneOf : [
8+ {
9+ title : 'String' ,
10+ type : 'string'
11+ } ,
12+ {
13+ title : 'Number' ,
14+ type : 'number'
15+ }
16+ ]
17+ }
18+ }
19+ } ;
20+
21+ export const uischema = {
22+ type : 'Control' ,
23+ label : 'Value' ,
24+ scope : '#/properties/value'
25+ } ;
26+
27+ const data = { } ;
28+
29+ registerExamples ( [
30+ {
31+ name : 'issue-1253' ,
32+ label : 'issue 1253 (oneOf)' ,
33+ data,
34+ schema,
35+ uischema
36+ }
37+ ] ) ;
Original file line number Diff line number Diff line change @@ -55,8 +55,11 @@ import * as object from './object';
5555import * as i18n from './i18n' ;
5656import * as issue_1169 from './1169' ;
5757import * as issue_1220 from './1220' ;
58+ import * as issue_1253 from './1253' ;
59+ import * as oneOfRecursive from './oneOf-recursive' ;
5860export * from './register' ;
5961export * from './example' ;
62+
6063export {
6164 allOf ,
6265 anyOf ,
@@ -90,5 +93,7 @@ export {
9093 object ,
9194 i18n ,
9295 issue_1169 ,
93- issue_1220
96+ issue_1220 ,
97+ issue_1253 ,
98+ oneOfRecursive
9499} ;
Original file line number Diff line number Diff line change 1+ import { registerExamples } from './register' ;
2+
3+ export const schema = {
4+ $schema : 'http://json-schema.org/draft-07/schema#' ,
5+ definitions : {
6+ fileOrFolder : {
7+ title : 'fileOrFolder' ,
8+ oneOf : [ { $ref : '#/definitions/file' } , { $ref : '#/definitions/folder' } ]
9+ } ,
10+ file : {
11+ title : 'File' ,
12+ type : 'object' ,
13+ properties : {
14+ name : { type : 'string' }
15+ }
16+ } ,
17+ folder : {
18+ type : 'object' ,
19+ title : 'Folder' ,
20+ properties : {
21+ name : { type : 'string' } ,
22+ children : {
23+ type : 'array' ,
24+ items : {
25+ $ref : '#/definitions/fileOrFolder'
26+ }
27+ }
28+ }
29+ }
30+ } ,
31+ type : 'object' ,
32+ properties : {
33+ root : {
34+ type : 'array' ,
35+ items : {
36+ $ref : '#/definitions/folder'
37+ }
38+ }
39+ }
40+ } ;
41+
42+ export const uischema = {
43+ type : 'Control' ,
44+ scope : '#'
45+ } ;
46+
47+ const data = { } ;
48+
49+ registerExamples ( [
50+ {
51+ name : 'oneOf-recursive' ,
52+ label : 'oneOf recursive' ,
53+ data,
54+ schema,
55+ uischema
56+ }
57+ ] ) ;
You can’t perform that action at this time.
0 commit comments