Open con-soa opened 2 years ago
Did you register the serializer with AddSerializer< StrawberryShakeDateTimeSerializer >()
?
Hi @PascalSenn ,
I must have missed that, sorry - I simply missed that part of the Scalar page, as it is only mentioned under "Advanced Example" and not referenced at all before.
Sorry - will try that, and close this.
Reopening, as adding the serializer in Startup.cs didn't work.
I introduced the DateTime serializer in Startup.cs:ConfigureServices:
public void ConfigureServices(IServiceCollection services)
{
services.AddSerializer<StrawberryShakeDateTimeSerializer>();
...
}
My serializer:
public class StrawberryShakeDateTimeSerializer : ScalarSerializer<string, DateTime>
{
public StrawberryShakeDateTimeSerializer() : base("AWSDateTime")
{
}
public override DateTime Parse(string serializedValue)
{
throw new NotImplementedException();
}
protected override string Format(DateTime runtimeValue)
{
throw new NotImplementedException();
}
}
Still gives "There is no formatter registered the specified type.".
Looking at the debugger, the ISerializerResolver has about 50 serializers, but none of them are for AWSDateTime.
Any ideas what I am missing, @PascalSenn ?
Is there an existing issue for this?
Describe the bug
Custom ScalarSerializer not found when when initializing client.
Steps to reproduce
Debugging confirms that the ScalarSerializer is not part of the list of Serializers.
Relevant log output
No response
Additional Context?
No response
Product
Strawberry Shake
Version
12.11.1