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
Add RawJObject
getter to StripeEntity
#1970
Conversation
@ob-stripe What's the difference with the approach we tried last year in #1707 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved but left some comments!
All fields are accessible, not just those that don't have normal accessors. So if someone uses |
It's not new but one thing that's a bit strange is that I was thinking we could move them to a new Example showing the current issue:
Ideally, there would be a way to populate the |
Also not sure if you looked into System.Text.Json? |
I'm pretty sure a custom json deserializer would be able to set a JObject property on all entities. |
Hey @clement911, thanks for all the feedback as usual :) I think having the For System.Text.Json looks interesting, and I would definitely favor a standard library solution over an external dependency like Newtonsoft.Json, but it looks like it's only available as of .NET Core 3.0. Unless it's backported to .NET Standard 2.0, we will be unable to use it :( Good point about the NRE, will add a check. |
724c6a1
to
3915ed7
Compare
Released as 35.11.0. |
This breaks my dotnet core 3 project not using Newtonsoft.Json as the serializer, and I would assume anyone using System.Text.Json. This is due to the JsonIgnore attribute from Newtonsoft not being used by System.Text.Json as it has it's own attribute. There is some more information under this section on the migration guide: https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to#conditionally-ignore-a-property
|
@sstalder Could you open a new issue about this? |
r? @remi-stripe
cc @stripe/api-libraries
Add
RawJObject
getter toStripeEntity
. This method returns aJObject
that can be used to access any properties contained in the JSON response, even if the library does not have a proper accessor for it.This is similar to the escape hatch we have in stripe-java: stripe/stripe-java#799