-
Notifications
You must be signed in to change notification settings - Fork 50
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
PolymorphismStyle.None #378
Comments
Thanks for the suggestion @mgroth0. If you're interested in submitting a PR with this change, I'd be happy to accept it. |
This issue has been automatically marked as stale because it has not had any activity in the last 60 days. It will automatically be closed if no further activity occurs in the next seven days to enable maintainers to focus on the most important issues. |
This issue has been automatically closed because it has not had any recent activity. |
@charleskorn I'm sorry I don't have time to submit a PR. Still though, can this be kept open? I think it is a valid suggestion. |
I'll take a look at a PR |
This implements charleskorn#378 by introducing a new `None` style that omits the tag/property entirely from the output yaml. Note this is asymmetric and reads are treated the same as `Tag` as reads require a tag. I added a few tests to JvmYamlWritingTest for both this case and some added coverage for the existing two cases as well.
Describe the problem you'd like to solve
I would like to serialize classes belonging to a polymorphic hierarchy as if they were not. I understand this means they can no longer be correctly deserialized, so I understand why there might be hesitation to support such a feature. Maybe it can be part of a separate API.
Describe the solution you'd like
allowing
PolymorphismStyle.None
, which would simply do nothing when a class is polymorphic, would work for me. Alternatively, having a separate method to serialize objects without considering if they are polymorphic would be ok.Describe alternatives you've considered
I am using
PolymorphismStyle.Tag
and trying to remove these tags by searching the string.Additional context
I may be serializing an object which will be deserialized in another program altogether, and that other program does not need the polymorphic tags.
The text was updated successfully, but these errors were encountered: