Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Conditional serialization #173

Closed
flip111 opened this issue Nov 1, 2013 · 1 comment
Closed

Conditional serialization #173

flip111 opened this issue Nov 1, 2013 · 1 comment

Comments

@flip111
Copy link

flip111 commented Nov 1, 2013

I have an array of objects. With object having properties type and allowedIds

array (
    object
        type: 1
        allowedIds: array()
    object
        type: 2
        allowedIds: array()
)

Is it possible to only serialize allowedIds if type is 1 ?

@flip111
Copy link
Author

flip111 commented Nov 1, 2013

I got an idea how to do this right after i posted. So if anyone wonders about this. It's possible to use VirtualProperty & @SerializedName and return null or just return; then the output won't be serialized.

@flip111 flip111 closed this as completed Nov 1, 2013
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant