-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
FeatureManagement.FeatureDto.IStringValueType Cause Newtonsoft.Json.JsonSerializationException #4337
Comments
Yes, that can be a problem we need to work on. |
@maliming this problem really happens and I think there are two possible solutions:
I prefer the 2nd option. If we write a custom deserializer, we can convert the following JSON: {
"features": [
{
"name": "MyProjectName.Feature1",
"displayName": "MyProjectName.Feature1",
"value": "B",
"description": null,
"valueType": {
"itemSource": {
"items": [
{
"value": "A",
"displayText": {
"resourceName": "MyProjectName",
"name": "AKey"
}
},
{
"value": "B",
"displayText": {
"resourceName": "MyProjectName",
"name": "BKey"
}
}
]
},
"name": "SelectionStringValueType",
"properties": {},
"validator": {
"name": "NULL",
"properties": {}
}
},
"depth": 0,
"parentName": null
}
]
}
Can you please work on that? If you have any question, please write to me. |
public interface IFeatureAppService : IApplicationService { Task<FeatureListDto> GetAsync([NotNull] string providerName, [NotNull] string providerKey); }
the GetAsync method Return FeatureListDto that contains IStringValueType.
In a monolithic application,It work well. But In microservices,IFeatureAppService as IRemoteService, and the returned Json format result,The Client cannot be serialized,it cause Newtonsoft.Json.JsonSerializationException: Could not create an instance of type Volo.Abp.Validation.StringValues.IStringValueType. Type is an interface or abstract class and cannot be instantiated.
How to deal with it?
The text was updated successfully, but these errors were encountered: