Skip to content

How to handle union types in query parameters? #1732

Answered by Romakita
gloomybrain asked this question in Q&A
Discussion options

You must be logged in to vote

You can try to use the OnDeserialize decorator. It's not possible to automatically deserialize union type.

@OnDeserialize(v => isObject(v) ? {lte: new Date(v.lte)} : new Date(v)) 

See you

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@gloomybrain
Comment options

@gloomybrain
Comment options

Answer selected by gloomybrain
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