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

Allow existing string property to be discriminant #718

Merged
merged 3 commits into from
Jun 19, 2018
Merged

Allow existing string property to be discriminant #718

merged 3 commits into from
Jun 19, 2018

Conversation

Dreamescaper
Copy link
Contributor

Fixes #686

Previously it was not possible to have existing property as discriminant.
With this PR it is allowed if this property is with string type.

@RicoSuter
Copy link
Owner

Thx for the PR. Doesnt this break serialization with the JsonInheritanceConverter or just ignore the property? Or what exactly is the purpose of this? Reading the discriminator for deserialized objects? Customizing it will probably not work...

@Dreamescaper
Copy link
Contributor Author

Dreamescaper commented Jun 18, 2018

Reading the discriminator for deserialized objects?

Exactly.

Doesnt this break serialization with the JsonInheritanceConverter or just ignore the property?

Hm. Yeah, I actually missed that, since I mostly cared about deserialization. Will update PR with fix.

@RicoSuter
Copy link
Owner

BTW: You can just update your branch, no need to create a new PR

@Dreamescaper
Copy link
Contributor Author

sure :)

Updated PR. Along with serialization fix, added several tests for JsonInheritanceConverter.

@RicoSuter
Copy link
Owner

@RicoSuter RicoSuter merged commit 9108d48 into RicoSuter:master Jun 19, 2018
@RicoSuter
Copy link
Owner

Thanks for the PR

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.

2 participants