Bank feed mapping type issue #628
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't expect you to merge this PR, I guess there's either a data issue or something wrong with the OpenAPI spec or Speakeasy ... However, I'm using this PR to demonstrate this issue.
When calling this endpoint https://docs.codat.io/bank-feeds-api#/operations/get-bank-account-mapping
Pydantic gets upset because the
sourceBalanceis not astr.If I edit the type to
intas per this PR then it works.Here's an example of the JSON returned from the API when calling via CURL or Postman etc. Notice that
sourceBalanceis0and not a string[ { "sourceAccountId": "acc-567", "targetAccountId": "d129850c-af5c-4e0c-90a9-9b3f3eb2d5b4", "feedStartDate": "2024-11-15T11:42:16.0000000", "status": "connected", "targetAccountOptions": [ { "name": "Seller Bank Account", "id": "4ad73daa-8b4d-4d84-9a5e-ad1a2d4f3f7f", "accountNumber": "56", "bankCode": "987654" }, { "name": "Lender Bank Account", "id": "56bbed02-93c5-4769-8c6f-5af8ed7b98c7", "accountNumber": "98765432", "bankCode": "765432" } ], "sourceAccountName": "account-123", "sourceAccountNumber": "11111111", "sourceBalance": 0, "sourceCurrency": "GBP", "targetAccountName": "Lender Bank Account", "targetAccountNumber": "98765432" } ]