feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
14.97k stars 744 forks source link

TypeError in getValidator with TUnion<TObject[]> #3256

Closed ps73 closed 9 months ago

ps73 commented 11 months ago

Steps to reproduce

It would be great if getValidator would support also supports TUnion<TObject[]> For example when having a schema like this:

export const userActionSchema = Type.Union([
  Type.Object({
    action: Type.Literal('verifySignup'),
    payload: Type.Object({
      verifyToken: Type.String(),
    }),
  }),
  Type.Object({
    action: Type.Literal('resendVerifySignup'),
    payload: Type.Object({
      email: Type.String({ format: 'email' }),
    }),
  }),
]);

Module versions (especially the part that's not working): 5.0.8