I believe the type of JsonSchema.examples is incorrect. According to https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-01#name-examples, the value of the attribute shouuld always be a list if present. However, the current type is JsonSchemaType | undefined, which includes many non-list types.
I think changing the type of the attribute to unknown[] would be more correct and allow removing some instances of @ts-expect-error (see below). Would that be a reasonable thing to do?
I believe the type of
JsonSchema.examplesis incorrect. According to https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-01#name-examples, the value of the attribute shouuld always be a list if present. However, the current type isJsonSchemaType | undefined, which includes many non-list types.I think changing the type of the attribute to
unknown[]would be more correct and allow removing some instances of@ts-expect-error(see below). Would that be a reasonable thing to do?valibot/packages/to-json-schema/src/converters/convertAction/convertAction.ts
Line 283 in e789528
valibot/packages/to-json-schema/src/converters/convertAction/convertAction.ts
Line 289 in e789528