Skip to content

Have a bug after migrating from beta.12 to beta.14 #1036

Answered by fabian-hiller
budarin asked this question in Q&A
Discussion options

You must be logged in to vote

Have a look at this playground. Here is the schema:

import * as v from 'valibot';

export const ResultResultSchema = v.object({
  id: v.union([v.string(), v.number()], 'id must be string or number'),
  result: v.union(
    [v.string(), v.number(), v.boolean(), v.array(v.unknown()), v.object({})],
    'result must be one of: string, number, array, boolean or object',
  ),
  error: v.optional(v.never('error must be undefined')),
});

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@budarin
Comment options

@fabian-hiller
Comment options

Answer selected by budarin
@fabian-hiller
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants