Checklist
Description
The User model uses StringOrObjectAsStringConverter, which is a converter implemented for System.Text.Json.
However, the property is decorated with the Newtonsoft.Json JsonConverter attribute:
[JsonConverter(typeof(StringOrObjectAsStringConverter))]
Newtonsoft.Json.JsonConverter and System.Text.Json.Serialization.JsonConverter are not compatible, so this converter will never work correctly with Newtonsoft and may even result in runtime or compilation issues depending on the implementation.
Reference:
|
[JsonConverter(typeof(StringOrObjectAsStringConverter))] |
I believe the converter should either:
- be replaced with a
Newtonsoft.Json.JsonConverter implementation, or
- the model should consistently use
System.Text.Json attributes and converters if the SDK is migrating away from Newtonsoft.
Reproduction
Just make a call to user by email endpoint.
Additional context
System.InvalidCastException: Unable to cast object of type 'Auth0.Core.Serialization.StringOrObjectAsStringConverter' to type 'Newtonsoft.Json.JsonConverter
auth0.net version
7
.NET version
10
Checklist
Description
The
Usermodel usesStringOrObjectAsStringConverter, which is a converter implemented for System.Text.Json.However, the property is decorated with the Newtonsoft.Json
JsonConverterattribute:Newtonsoft.Json.JsonConverterandSystem.Text.Json.Serialization.JsonConverterare not compatible, so this converter will never work correctly with Newtonsoft and may even result in runtime or compilation issues depending on the implementation.Reference:
auth0.net/src/Auth0.ManagementApi/Models/Users/User.cs
Line 51 in fac6642
I believe the converter should either:
Newtonsoft.Json.JsonConverterimplementation, orSystem.Text.Jsonattributes and converters if the SDK is migrating away from Newtonsoft.Reproduction
Just make a call to user by email endpoint.
Additional context
System.InvalidCastException: Unable to cast object of type 'Auth0.Core.Serialization.StringOrObjectAsStringConverter' to type 'Newtonsoft.Json.JsonConverter
auth0.net version
7
.NET version
10