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

make optional event attributes optional #1936

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m-mattia-m
Copy link

When my API receives a webhook request from Stripe via the CLI, I get the error expected required property account to be present and the location attribute is: body. After creating a manual request with the same body and adding the 'account' attribute (which is an empty string), I got the same error for the 'previous_attributes' attribute in the 'body.data' location. After adding that element as well, it worked.

I checked the stripe docs, I saw that the account' attribute is a nullable string'. The previous_attributes is a nullable map. However, the stripe-go-sdk considers these attributes to be required attributes.

Stripe Docs - The Event object

Copy link

cla-assistant bot commented Oct 13, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

cla-assistant bot commented Oct 13, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@jar-stripe
Copy link
Contributor

Hi @m-mattia-m! Thanks for opening this PR! The events.go file is actually generated from our API specification, so we'll need to look at what may be causing these fields to not be marked correctly as optional. Would you mind also opening a GH issue that describes the issue? If you can include an example snippet of code and commands to run to show the error, that would be awesome. We can do some investigation internally, and then collaborate on the fix on this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants