Skip to content
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

Add JsonConverters for both COM _and_ ENUM Verwendungszweck #400

Closed
wants to merge 4 commits into from

Conversation

hf-kklein
Copy link
Collaborator

wer soll das verstehen?

@hf-kklein hf-kklein requested a review from JoschaMetze January 16, 2024 16:19
/// <inheritdoc />
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
writer.WriteValue(value);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
writer.WriteValue(value);
try
{
writer.WriteValue(value);
}
catch (JsonWriterException jwe) when (jwe.Path == "marktlokation.boModel.zaehlwerke[0].verwendungszwecke") // ("Unsupported type: BO4E.COM.Verwendungszweck. Use the JsonSerializer class to get the object's JSON representation. Path 'marktlokation.boModel.zaehlwerke[0].verwendungszwecke'."))
{
// I have no clue what to do here and why we even need this catch block
serializer.Serialize(writer, (Verwendungszweck)value);
}

@hf-kklein hf-kklein closed this Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant