-
Notifications
You must be signed in to change notification settings - Fork 183
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
Supporting multiple keys for the same field during deserialization #1169
Comments
I think that this PR exactly does what you want by adding an --but there hasn't been any update there in a while; let me ask. Thanks. |
@davidmorgan That's exactly what I am looking for and it looks like the PR is almost done. Thanks! |
you can simple write plugin for it, something like this
|
Problem statement:
I have a model called "Calendar" which needs to parse either the following json
or the following one depending on some use cases
Basically the value will be the same only difference is the key. The reason for this is that the "Calendar" model has lots of fields and this data is in a file which is kept in the asset folder of the application. So, the fields are shortened to reduce some space taken by the file.
For deserialization, I need to be able to parse the json with both possible keys for the same value. But for serialization I only need the keys shown in the second json so no problem with serialization.
The interim solution that I am using is the following:
So, is there any possible way to add two "wireName" for the same field? Or any workaround so that I don't have to manually add two cases everytime I need to change or add a new field.
The text was updated successfully, but these errors were encountered: