Skip to content

Commit

Permalink
source-stripe-native: make created optional for Accounts
Browse files Browse the repository at this point in the history
Sometimes, `account.updated` events do not have `created` in the document, causing failures when we validate the document against its model. Making `created` optional will avoid these failures and reflect the API's actual response.
  • Loading branch information
Alex-Bair committed Sep 24, 2024
1 parent 911128f commit 122b031
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions source-stripe-native/source_stripe_native/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ class Accounts(BaseStripeObjectWithEvents):
"account.updated": "u",
}

# Accounts docs returned in account.updated events may not have a created field.
created: int | None = None

# Could not verify Persons events are generated in test mode, but suspect
# they are generated in Stripe's live mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,21 @@
"type": "string"
},
"created": {
"title": "Created",
"type": "integer"
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Created"
}
},
"required": [
"id",
"object",
"created"
"object"
],
"title": "Accounts",
"type": "object",
Expand Down

0 comments on commit 122b031

Please sign in to comment.