You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per default, `getTemplate` does try to create data that is valid to the json-schema. Example: array-schemas with `minItems: 1` will add one item to fullfil the validation criteria. You can use the option and pass `{ extendDefaults: false }` to override this behaviour with a default value:
274
+
275
+
```ts
276
+
import { Draft07 } from"json-schema-library";
277
+
278
+
const myJsonSchema = {
279
+
type: "array",
280
+
default: [], // if omitted will add an array item
281
+
items: {
282
+
type: "string",
283
+
enum: ["one", "two"]
284
+
},
285
+
minItems: 1// usually adds an enty, but default states: []
0 commit comments