#is there a way to validate object but not nested)?
10 messages · Page 1 of 1 (latest)
Can you elaborate? I have no idea what you're trying to say..
but dynamic keys are impossible to validate using a class
I just need to validate request that could have dynamic keys (keys are just a random names and that could be many of them) and values that could be any
if that's impossible using class are there any other approaches?
Json schema (using AJV) for example, but, you'll need a custom validation pipe for that
But if you can accept random keys with any value, then what is there to validate?
just that object is not empty)
I need at least one key:value
and I should not pass for example
{"asdf"}
It might be easiest to just check that condition in the controller rather than coming up with an elaborate solution