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

Fix JSON serialization of Stripe objects #1433

Merged
merged 6 commits into from
Dec 18, 2018

Conversation

ob-stripe
Copy link
Contributor

@ob-stripe ob-stripe commented Dec 14, 2018

r? @remi-stripe
cc @stripe/api-libraries

  • Adds ToString and ToJson methods to StripeEntity
  • Exclude StripeResponse from JSON serialization
  • Fix serialization of expandable attributes
  • Don't serialize deleted attribute when it's null
  • Add a test for serialization of expandable fields

I realize that the new getters for expandable fields add a lot of boilerplate. In the future, I'll probably replace the object declarations with an ExpandableField<> generic class and a custom serializer/deserializer, similar to what we do in Java, but for now this does the job.

@ob-stripe ob-stripe force-pushed the ob-expandable-getters branch 2 times, most recently from a23ba8d to 72757ae Compare December 14, 2018 19:38
@ob-stripe ob-stripe changed the title [wip] Fix JSON serialization of Stripe objects Fix JSON serialization of Stripe objects Dec 14, 2018
@ob-stripe ob-stripe mentioned this pull request Dec 14, 2018
29 tasks
@ob-stripe
Copy link
Contributor Author

ob-stripe commented Dec 14, 2018

Aw, Windows outputs CRLF line endings. Will fix.

edit: fixed.

@ob-stripe ob-stripe force-pushed the ob-expandable-getters branch 2 times, most recently from e01927a to 6937f11 Compare December 16, 2018 20:49
@ob-stripe ob-stripe force-pushed the ob-expandable-getters branch from 6937f11 to dfe52b3 Compare December 17, 2018 09:02
@remi-stripe remi-stripe assigned ob-stripe and unassigned remi-stripe Dec 18, 2018
@ob-stripe ob-stripe assigned remi-stripe and unassigned ob-stripe Dec 18, 2018
@ob-stripe
Copy link
Contributor Author

Added a wholesome test, ptal @remi-stripe

@remi-stripe remi-stripe assigned ob-stripe and unassigned remi-stripe Dec 18, 2018
@ob-stripe ob-stripe merged commit dcc89b7 into integration-v23 Dec 18, 2018
@ob-stripe ob-stripe deleted the ob-expandable-getters branch December 18, 2018 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants