Replies: 9 comments
-
For the first issue, could you provide the trace as well as the For the second, it should work to create custom cases for |
Beta Was this translation helpful? Give feedback.
-
First issue - No coercion operator is defined between types 'System.String' and 'System.Char[]'.Trace:
Simplified class, without multiple, additional properties, stripped of ProtoMemberAttributes:
Eveery other property gets mapped, except for that Second issueI would like to use |
Beta Was this translation helpful? Give feedback.
-
It looks like Custom serde cases would be the way to handle value type conversions as well: implement a case that matches the |
Beta Was this translation helpful? Give feedback.
-
Well, cannot really go with |
Beta Was this translation helpful? Give feedback.
-
Hmm, I'm unable to reproduce with the following code on .NET 7: var schemaBuilder = new SchemaBuilder(
memberVisibility: BindingFlags.Public | BindingFlags.Instance,
enumBehavior: EnumBehavior.Symbolic,
nullableReferenceTypeBehavior: NullableReferenceTypeBehavior.Annotated,
temporalBehavior: TemporalBehavior.Iso8601);
var schemaBuilderContext = new SchemaBuilderContext();
var schema = schemaBuilder.BuildSchema<Request>(schemaBuilderContext);
var deserializer = new BinaryDeserializerBuilder(
BinaryDeserializerBuilder
.CreateDefaultCaseBuilders()
)
.BuildDelegate<Request>(schema); Which version of .NET and which version of Chr.Avro are you using? |
Beta Was this translation helpful? Give feedback.
-
.net 7 and 9.4.1 - latest. i am unable to provide the whole project with repro today. I assume it won't be so easy to reproduce it without the whole context... |
Beta Was this translation helpful? Give feedback.
-
I have sent you link to the repo with reproduced issue. EDIT: Could you explain what did you mean by?
|
Beta Was this translation helpful? Give feedback.
-
When I run the reproduction locally, this is the trace I see:
If I remove the
I’ll try to be a little more detailed. The easiest path would probably be to create a class that extends |
Beta Was this translation helpful? Give feedback.
-
i am in the same situation (though with a different type than int). i'm able to change my class so that it has a getter/setter property that handles the conversion to a map with a string key. still, i wish there were a way to do this in the library. (i'm serializing to json for now.) |
Beta Was this translation helpful? Give feedback.
-
Hi,
this is really a question regarding 2 seperate issues, but I did not want to create 2 issues.
The first thing, it looks like a bug to me. So I have a following class (which is nested in the main class
TestClassRoot
):During deserialization process I am getting following error message:
No coercion operator is defined between types 'System.String' and 'System.Char[]'.
Which, to me, is kinda strange, when I have couple dozen of similar properties and they deserialize correctly.
I am using following code to build schema:
Also, deserializer are basic, deserializer for reference:
The other issue is related to the serializing and deserializing C#'s
Dictionary<int, T>
.How can I embed a rule in
SchemaBuilder
to support that kind of conversion? Or should I create a custom deserializer?As a workaround I create another property with supported type (
Dictionary<string, string>
) and do parsing under the hood, which is not really sustainable...Beta Was this translation helpful? Give feedback.
All reactions