stripe / stripe-dotnet

Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com.
Apache License 2.0
1.37k stars 571 forks source link

AOT compatibility #2967

Open cacowen opened 2 months ago

cacowen commented 2 months ago

Is your feature request related to a problem? Please describe.

Currently the workflow to capture Webhooks and other models depends on direct JSON transformations and furthermore relies on Newtonsoft. These add a lot of overhead in my otherwise simple Lambda function. And pretty much eliminates the AOT benefits.

Describe the solution you'd like

I would like to be able to use stripe-dotnet in a .Net 8 AOT AWS Lambda Function without bypassing trimming and other AOT features. It would be nice to have stripe models that do not rely on Newtonsoft and can easily be added to a JSON serializer context.

Describe alternatives you've considered

No response

Additional context

Perhaps I am just using this the wrong way. I have tried to follow examples here and in YouTube (including the Stripe Developers channel). So far, I have not been able to use this in an AOT application in a straightforward and clean way.

jar-stripe commented 1 month ago

Hi @cacowen, thanks for the request! I can definitely see the use case here. We're planning to look into using System.Text.Json as an alternative to Newtonsoft soon, and I suspect we'll have to get thru at least that work before we can try to understand what we need to do to support this. Unfortunately I can't make commitments about prioritization in the future, but we are tracking it. Thanks again!