DEV Community

Cover image for Reject JSON Keys You Did Not Ask For
YeLinAung for dust

Posted on Originally published at dust-codegen.pages.dev

Reject JSON Keys You Did Not Ask For

Dust Serde strict-key model rejecting an unexpected admin field

Extra JSON keys can hide a server and client mismatch. Add disallowUnrecognizedKeys: true to a Dust Serde model. Decoding then rejects any key that is not a field or alias instead of silently accepting it.

Read the Dust Serde configuration guide.

Dust #Serde #JSON #CodeGeneration

Top comments (0)