Skip to content

Commit ba60bec

Browse files
committed
Improve README
1 parent d27d402 commit ba60bec

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ To:
5353
}
5454
```
5555

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+
5658
### Types in an array to OneOf
5759

5860
This will convert a schema of:
@@ -88,6 +90,41 @@ To:
8890
}
8991
```
9092

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+
91128
### Const to enum
92129

93130
This will convert a schema of:

0 commit comments

Comments
 (0)