-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Int Array not working with FormData #1840
Comments
With a client generated with the C# generator? Or how to do you get this request? |
To me this looks more like a Swagger UI 3 bug (which is only bundled into nswag but an external project) |
I forgot to mention that the same happens when using the api from the generated typescript clients. Could it be a bug related to dotnet core 2.2? |
Not sure if this feature is already supported in the typescript/c# generators... what is the output for this operation? |
This is the generated typscript for the controller. update(ids: number[] | undefined): Promise<Item> {
let url_ = this.baseUrl + "/api/item/update";
url_ = url_.replace(/[?&]$/, "");
const content_ = new FormData();
if (ids === null || ids === undefined)
throw new Error("The parameter 'ids' cannot be null.");
else
content_.append("ids", ids.toString());
let options_ = <RequestInit>{
body: content_,
method: "POST",
headers: {
"Accept": "application/json"
}
};
return this.http.fetch(url_, options_).then((_response: Response) => {
return this.processUpdate(_response);
});
} |
I'm having the same issue--when using curl to POST, it works, yet the swagger form (identical to the one posted above) generated by UseSwaggerUi3 does not pass the integer array. Wonder if there are any known workarounds. |
If I use an array of integer in formdata i receive a 400 error ["The value '"1","2"' is not valid."]}
This happens when i try the api from the Swagger UI.
Anyone knows if this is a bug or if I am misssing something?
The text was updated successfully, but these errors were encountered: