Schema
/ API Reference / BuildersSchema
/ API Reference / BuilderscreateArraySchema
A function that creates a JSON array schema.
The Gist
import { createArraySchema, createStringSchema } from '@weser/schema'
const stringSchema = createStringSchema()
const schema = createArraySchema(stringSchema)
const schemaWithOptions = createArraySchema(stringSchema, {
default: ['foo', 'bar'],
})
Parameters
Parameter | Type | Description |
---|---|---|
items | T_JSONSchema | The JSON schema of the items in the array. |
options | Options? | The options for the array schema. |
Options
Parameter | Type | Description |
---|---|---|
description | string ? | The description of the array schema. |
default | Array<T> ? | The default value of the array schema. |
Returns
(T_JSONSchemaArray) A JSON array schema.
© 2024-present Robin Weser. All Rights Reserved.