You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I query a rest api and get a json result containing fields "broadcaster_login" and "id". Those are put into a record with the property "ID" that has a JsonProperty attribute with value broadcaster_login. Refit puts the id field there instead of broadcaster_login. If I name the property "Login", it works fine and I get the expected field.
It might be that refit only looks as the property name attribute if it doesn't find an exact match with the property's name.
result contains the streamers' ids instead of the broadcaster_logins
rename string ID to string Login and see the correct result
Reproduction repository
No response
Expected behavior
If a JsonProperty attribute is present for a property, it should take precedence over the property name when matching to json fields if deserializing with the NewtonsoftJsonContentSerializer.
Screenshots 🖼️
No response
IDE
Visual Studio 2022
Operating system
Windows
Version
10
Device
No response
Refit Version
7.2.1
Additional information ℹ️
No response
The text was updated successfully, but these errors were encountered:
Describe the bug 🐞
I query a rest api and get a json result containing fields "broadcaster_login" and "id". Those are put into a record with the property "ID" that has a
JsonProperty
attribute with valuebroadcaster_login
. Refit puts the id field there instead of broadcaster_login. If I name the property "Login", it works fine and I get the expected field.It might be that refit only looks as the property name attribute if it doesn't find an exact match with the property's name.
Step to reproduce
record Streamers( [property: JsonProperty( "data" )] StreamersData[] Data );
GetStreamers
string ID
tostring Login
and see the correct resultReproduction repository
No response
Expected behavior
If a
JsonProperty
attribute is present for a property, it should take precedence over the property name when matching to json fields if deserializing with theNewtonsoftJsonContentSerializer
.Screenshots 🖼️
No response
IDE
Visual Studio 2022
Operating system
Windows
Version
10
Device
No response
Refit Version
7.2.1
Additional information ℹ️
No response
The text was updated successfully, but these errors were encountered: