AdRi🅰nSiT🅾🤔
JsonSerializerOptions Ignore when null
Hey guys, I'm writing on an API and we have some values that can be null. I'm looking to hide those out if they are null. What I was doing so far was to use at property level the following:
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
As far as I've seen in stackoverflow and somewhere else is that I could have something like this for applying that to all of the properties:
This so far is not hiding the null values for all of the properties
This is an example of the response object on the api:
35 replies