File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 53
53
}
54
54
```
55
55
56
+ At the moment, this library cannot handle more than one item in the array, and so will default to using the first item only.
57
+
56
58
### Types in an array to OneOf
57
59
58
60
This will convert a schema of:
88
90
}
89
91
```
90
92
93
+ Where an array contains ` null ` , it will now set ` nullable ` against all types:
94
+
95
+ ``` json
96
+ {
97
+ "type" : " object" ,
98
+ "properties" : {
99
+ "example" : {
100
+ "type" : [" string" , " number" , " null" ],
101
+ }
102
+ }
103
+ }
104
+ ```
105
+
106
+ To:
107
+
108
+ ``` json
109
+ {
110
+ "type" : " object" ,
111
+ "properties" : {
112
+ "example" : {
113
+ "oneOf" : [
114
+ {
115
+ "type" : " string" ,
116
+ "nullable" : true
117
+ },
118
+ {
119
+ "type" : " number" ,
120
+ "nullable" : true
121
+ }
122
+ ]
123
+ }
124
+ }
125
+ }
126
+ ```
127
+
91
128
### Const to enum
92
129
93
130
This will convert a schema of:
You can’t perform that action at this time.
0 commit comments