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
@@ -22,36 +22,36 @@ This package is particularly popular for:
22
22
23
23
**Note**: Converted schemas may behave slightly differently in JSON schema validators (especially for string format) because their implementation is different from Valibot's.
| typeMode |`'ignore' \| 'input' \| 'output'`| Whether to convert the input or output type of the Valibot schema to JSON Schema. |
101
-
| errorMode |`'throw' \| 'warn' \| 'ignore'`| The policy for handling incompatible schemas and actions. |
102
-
| definitions |`Record<string, GenericSchema>`| The schema definitions for constructing recursive schemas. If not specified, the definitions are generated automatically. |
103
-
| overrideSchema |`(context: OverrideSchemaContext) => JSONSchema7 \| null \| undefined`| Overrides the JSON Schema conversion for a specific Valibot schema. |
104
-
| ignoreActions |`string[]`| The actions that should be ignored during the conversion. |
105
-
| overrideAction |`(context: OverrideActionContext) => JSONSchema7 \| null \| undefined`| Overrides the JSON Schema reference for a specific Valibot action. |
106
-
| overrideRef |`(context: OverrideRefContext) => string \| null \| undefined`| Overrides the JSON Schema reference for a specific reference ID. |
| target |`'draft-07' \| 'draft-2020-12' \| 'openapi-3.0'`| The target JSON Schema format. Defaults to `'draft-07'`. |
101
+
| typeMode |`'ignore' \| 'input' \| 'output'`| Whether to convert the input or output type of the Valibot schema to JSON Schema. |
102
+
| errorMode |`'throw' \| 'warn' \| 'ignore'`| The policy for handling incompatible schemas and actions. |
103
+
| definitions |`Record<string, GenericSchema>`| The schema definitions for constructing recursive schemas. If not specified, the definitions are generated automatically. |
104
+
| overrideSchema |`(context: OverrideSchemaContext) => JsonSchema \| null \| undefined`| Overrides the JSON Schema conversion for a specific Valibot schema. |
105
+
| ignoreActions |`string[]`| The actions that should be ignored during the conversion. |
106
+
| overrideAction |`(context: OverrideActionContext) => JsonSchema \| null \| undefined`| Overrides the JSON Schema reference for a specific Valibot action. |
107
+
| overrideRef |`(context: OverrideRefContext) => string \| null \| undefined`| Overrides the JSON Schema reference for a specific reference ID. |
108
+
109
+
### Target format
110
+
111
+
The `target` configuration allows you to specify which JSON Schema format to generate. Different targets have different capabilities and syntax:
Converts a Valibot schema to the [Standard JSON Schema](https://standardschema.dev/) format. This format is useful when working with tools and libraries that support the Standard JSON Schema specification.
Converts only the provided Valibot schema definitions to JSON Schema definitions, without wrapping them in a root schema. This is particularly useful for OpenAPI specifications where you need only the schema definitions.
0 commit comments