MCPcopy
hub / github.com/vantezzen/autoform / SchemaProvider

Interface SchemaProvider

packages/core/src/schema-provider.ts:10–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8 * They also handle validating the form value and returning error messages in a consistent format.
9 */
10export interface SchemaProvider<T = any> {
11 /**
12 * Parse the schema into a format that AutoForm can use.
13 */
14 parseSchema(): ParsedSchema;
15
16 /**
17 * Validate the form values against the schema.
18 * This returns either the transformed result (e.g. with date coersion) or an array of errors.
19 *
20 * @param values - Form values to validate
21 */
22 validateSchema(_values: T): SchemaValidation;
23
24 /**
25 * Get the default values for the fields.
26 * This is used to populate the form with initial values.
27 *
28 * @returns Default values for the form
29 */
30 getDefaultValues(): Record<string, any>;
31}

Callers 7

parseSchemaFunction · 0.65
parseSchemaMethod · 0.65
handleSubmitFunction · 0.65
validateSchemaFunction · 0.65
validateSchemaMethod · 0.65
getDefaultValuesFunction · 0.65
getDefaultValuesMethod · 0.65

Implementers 5

JoiProviderpackages/joi/src/provider.ts
YupProviderpackages/yup/src/provider.ts
ZodProviderpackages/zod/src/merge/provider.ts
ZodProviderpackages/zod/src/v3/provider.ts
ZodProviderpackages/zod/src/v4/provider.ts

Calls

no outgoing calls

Tested by

no test coverage detected