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

MultiPartException('Missing boundary in multipart.') using test_client() on "multipart/form-data" API content #1966

Open
alanbchristie opened this issue Aug 21, 2024 · 0 comments

Comments

@alanbchristie
Copy link

Description

I'm using connexion (v3.1.0) in unit testing. I have an API endpoint that uses content that multipart/form-data content. In connexion v2 (v2.14.2) this was possible. In connexion v3 I appear to be unable to test these endpoints without encountering a MultiPartException('Missing boundary in multipart.') ERROR.

For more details you can see connexion discussion 1964.

Expected behaviour

I should be able to use the test_client() to test APIs with multipart/form-data content. This might be a problem with connexion or starlette, it's certainly not something the test should need to be responsible for - after all the content tells the test client what's expected - I present data (in a Dictionary) - the test client adjusts it to satisfy the defined content for the API being tested.

Actual behaviour

I get an exception: -

ERROR    connexion.middleware.exceptions:exceptions.py:108 MultiPartException('Missing boundary in multipart.')

Steps to reproduce

See connexion discussion 1964.

Additional info:

Output of the commands:

  • python --version (Python 3.12.4)
  • pip show connexion | grep "^Version\:" (Version: 3.1.0)
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

No branches or pull requests

1 participant