#Magic Mage
1 messages ยท Page 1 of 1 (latest)
@candid timber let's chat here!
Ok
Something seems to happen when I use these query params inside of SubscriptionService.CancelAsync()
perhaps it does not like those strings being empty?
could you copy/paste that subscription ID so I don't mess up any of the characters when searching on my end?
@candid timber just making sure you saw my message since you appear to be offline
ok
I am always set to invis to avoid people trying to scam on discord.
sub_1Mt7uCIGajkrXKj9DKCghRwm
ah, looks like an error is being returned because of the blank/empty feedback. I recommend omitting the cancellation_details hash altogether if you're not passing any values for comment and feedback
ah you can do that? I thought I could not because of the lack of an ? on the signature on the cancel options class.
So that might need to add the little ? to that details part.
Yep, it's possible. Technically, all parameters for the subscription cancellation request are optional. The only bit that's required is the subscription ID
ok
do you happen to know if it's possible to have the ai update that file in stripe.net to add the ? to the above type?
I would hate to need to make the change manually ๐ .
Not quite sure I follow your question.
Basically can it be made to have the bot that opens pull requests to stripe.net to update that file to make CancelationDetails get the nullable annotation ??
(this is because to me when I see a property not marked as that I assume it's required, this is because for 99.9% of cases it actually is)
strings are always optional so we never add the ? for it right?
ultimately this API Request should absolutely not 5xx
strings are a special type in .NET to where they can be:
- null
- empty
- not empty (or has only whitespace)
However the class those are stored in is not always the same case though hence why I feel that annotating that type used there on that property as nullable is a good idea to let the developer know that it's optional.
the point I am making is that, AFAIK, we never say anywhere ? for string parameters in stripe-dotnet
and likely never will
Yeah
I was referring to make the SubscriptionCancellationDetailsOptions property in SubscriptionCancelOptions nullable though.
I don't disagree it'd be good. We added it for other scalar types like DateTime and decimal but we won't for strings
and really same, we never set ? for "hashes"
like https://github.com/stripe/stripe-dotnet/blob/master/src/Stripe.net/Services/Subscriptions/SubscriptionCreateOptions.cs#L61
this is optional and there's no ?, it's implicit because it's a hash
oh
Would this be a good change I made earlier though (since it seems the ai skipped it on stripe-dotnet currently)? https://github.com/stripe/stripe-dotnet/pull/2673
yeah we didn't really skip anything per se. Just that file is not automatically generated
oh
there's likely a jira from me from 3.5 years ago saying "hey we should fix this" bumped every quarter
๐น
Well at least I did that task for you today ๐ .
Files automatically generated by our "AI" have
``` at the top
But really going to go and yell a bit, the fact that you hit this and had to do the PR yourself is a bit "ugh" :p
I wonder why that file is not auto generated.
it's ok though, at least it was noticed sooner rather than later.
I actually wonder though who does the reviews and merges though, and if the pr I opened can be ported to the beta as well (or if it should just start there) ๐ .
humans review and merge right now though we mostly trust the code generated (it's reviewed earlier in our process internally as part of real code changes to our API)
and your change is about a public feature so it definitely should go in the public library
yes, when a human has reviewed and then merged/released. Might take a couple of days
ok