Zod schema and option set #6325
-
Is there any way to declare option set with Zod schema? Let's say I have appId, appObjectId and appName option, but only one option can be specified. Checking Zod documentation, but I can't find any info. Or is there any util function for option set? Option sets are heavily used. It would be nice to have a function for options sets validation before we start delivering new commands with Zod schema |
Beta Was this translation helpful? Give feedback.
Answered by
waldekmastykarz
Sep 9, 2024
Replies: 1 comment 2 replies
-
I believe we checked this and there was a way. @waldekmastykarz can you clarify this? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, there is. We use schema refinements for this. Check out
cli-microsoft365/src/m365/commands/login.ts
Lines 50 to 81 in 8c76288