Skip to content

Conversation

@ianardee
Copy link
Contributor

Fixed API error when using base64

Description

Force use of filename when using base64 input type to comply with the API.

Motivation and Context

mindee.http.HTTPException:
Receipt API 400 HTTP error: {"api_request": {"error": {"code": "BadRequest", "details": {"document": ["File must be one of binary file, URL or base64"]}, "message": "Invalid fields in form"}, "resources": [], "status": "failure", "status_code": 400, "url": "http://api.mindee.net/v1/products/mindee/expense_receipts/v3/predict"}}

How Has This Been Tested

Added unit test, updated tests to more easily detect this sort of problem in the future.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Contributor

@jonathanMindee jonathanMindee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great thank you!

@ianardee ianardee merged commit e1bb1ba into main Jan 18, 2022
@ianardee ianardee deleted the fix-base64 branch January 18, 2022 13:58
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.

3 participants