Skip to content

Individually validating key/value pairs in a type #830

Answered by ssalbdivad
kasperbb asked this question in Q&A
Discussion options

You must be logged in to vote

At some point, we'll add the ability to index in to types like "myType['foo']" (like TS) and probably additionally using the JS dot notation i.e. myType.foo.

I've created an issue to track that here:

#831

For now, I think the easiest thing to do would just be to have a list of "optional" aliases passed to Example. When validating an alias from that list, you could check if the input was undefined before passing it to the scope validator and allow it.

Let me know if that feels like an acceptable intermediate solution!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kasperbb
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