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

fix scalar as list with multi selects #141

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

schatimo
Copy link

This PR fixes #122.

Copy link

codecov bot commented Dec 31, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cec25c6) 94.05% compared to head (ef4a424) 94.05%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #141   +/-   ##
=======================================
  Coverage   94.05%   94.05%           
=======================================
  Files          11       11           
  Lines         723      723           
=======================================
  Hits          680      680           
  Misses         43       43           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@schatimo schatimo changed the title fix scalar as list with multi selects #122 fix scalar as list with multi selects Dec 31, 2023
@samuelcolvin
Copy link
Member

Looks good, please can you add a test, also I think there's another field that needs the same.

@schatimo
Copy link
Author

Sure, I added a test for the validation method to make sure that we get a 200 response when the argument is a str but the pydantic model expects a list[str].

Before filing the PR, I checked the model BigModel and in particular the field profile_pics which is of type Annotated[list[UploadFile], FormFile(accept='image/*')] | None. However, there I did not receive a 422 error when providing only one file.

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.

Bug with multi select fields
2 participants