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

Parsing Custom Objects Using TypeConvertors #180

Open
ojhariddhish opened this issue Sep 18, 2016 · 3 comments
Open

Parsing Custom Objects Using TypeConvertors #180

ojhariddhish opened this issue Sep 18, 2016 · 3 comments

Comments

@ojhariddhish
Copy link

Hi,
This is not an issue, just a problem parsing with my json structure.
I have to parse a json object similar to this:
custom_accounts.json.txt

The account object in the Accounts array is always different and I've to identify that based on the account_type field. I have 3 different Account classes that extend from the default Account class.

I tried creating a global account object with all the fields from these 3 account types but there are some custom fields who have the same name but are of different class type which creates a conflict. So I can't use this solution.

I want to create a TypeConvertor for my custom class to convert them based on the account_type field or reflection. How should I implement this?

@ursusursus
Copy link

I need this too

@lhalegria
Copy link

Hi @ojhariddhish!

how did you resolve this issue?

@ojhariddhish
Copy link
Author

Sorry, @lhalegria, I couldn't. I couldn't find anything on stackoverflow or anywhere regarding this issue either. So, I asked the backend team to change the json structure.

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

No branches or pull requests

3 participants