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

[BUG] Openapi generated docs won't submit arrays correctly in forms. #1289

Open
KonstantinosPetrakis opened this issue Aug 30, 2024 · 1 comment

Comments

@KonstantinosPetrakis
Copy link

KonstantinosPetrakis commented Aug 30, 2024

Greetings. There's been an issue to the problem I am referring to, which was closed for no reason to my understanding.

Essentially, when you define a Schema with a List[str] field the openapi generated documentation is not in sync with what the schema excepts.

The schema excepts a repeated value (e.g names=John&names=Jane) or through JavaScript code:

const names = ["John", "Jane"];
const form = new FormData();
for (const name of names) form.append("names", name);
// make request

But the openapi docs send a single comma separated string resulting to an array with a single item containing that string (e.g ["John, Jane"].

The documentation is supposed to work out of the box. User code checking for commas to fix that library issue shouldn't be acceptable (what if the separated string contained a comma itself?).

@KonstantinosPetrakis
Copy link
Author

As the author of the original issue mentioned it most likely has to do something with explode:false.

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