-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JwtBuilder doesn't respect System.Text.Json.Serialization.JsonPropertyName attribute when deserializing into a record #379
Comments
Hi, jwt/src/JWT/Builder/JwtBuilder.cs Lines 80 to 84 in 5d59adf
Then ideally I'd ask you to contribute to the library and ship the implementation as an extension, see: |
Alright thank you, though it's still weird that it does respect the attribute when serializing.
Maybe, I'm still new to C#, I'll think about it. |
To explain little more: those are 2 different JSON serializing libraries with their own set of attributes, what means one is unaware of the another. |
Oh I understand that, which is why it's so weird that one library is partially respecting the attributes of another. |
Sorry, it might be confusing indeed. |
I have this record and this code
In this case, data is an instance of
UserJwtTokenPayload
with default values because.Decode<...>(...)
does not respect the[JsonPropertyName(...)]
attribute.If I were to rewrite this to use
System.Text.Json
, this works just fine. Example:It seems that it should be respecting
JsonPropertyName
attributes when decoding as the library does when actually encoding.The text was updated successfully, but these errors were encountered: