form icon indicating copy to clipboard operation
form copied to clipboard

Support DisallowUnknownKeys option

Open ansel1 opened this issue 7 years ago • 2 comments

Not crazy about the name, but essentially an option like gorilla/schema's IgnoreUnknownKeys option. Useful for really strict validation of incoming query params.

ansel1 avatar Feb 05 '18 15:02 ansel1

💡 I like the idea @ansel1

I’ll have to think about how to implement as this library sets the data from the structs perspective and not the incoming data, but I’ll figure something out

deankarn avatar Feb 05 '18 16:02 deankarn

maybe add a slice or map to decoder to track used keys, then compare to original values at the end of Decoder.Decode()

ansel1 avatar Feb 05 '18 22:02 ansel1