Skip to content

How to force System.Text.Json deserializer to throw an exception when property is missing in JSON? #83362

Discussion options

You must be logged in to vote

Doesn't [JsonRequired] throw on missing values?

Yes but i don't want to add it to all properties. I want all properties to be required by default.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@eiriktsarpalis
Comment options

@Xyncgas
Comment options

@krwq
Comment options

krwq Mar 14, 2023
Collaborator

Answer selected by InternalHigh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
Converted from issue

This discussion was converted from issue #83357 on March 14, 2023 00:23.