-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Describe the bug
When updating OpenApiOperation body Parameter Name,
original Request body content type changed.
Version of NSwag toolchain, computer and .NET runtime used
Reproduced on last version.
To Reproduce
Take an multipart/form-data content body schema :
"requestBody": {
"content": {
"multipart/form-data": {
}
}
}
When manipulating body parameter's Name (don't know if only this property concerned)
Schema content type change to "application/json"
Simple sample :
OpenApiDocument document = ...;
document.Operations
.SelectMany(op => op.Operation.Parameters)
.ForEach(p=>
{
p.Name = "new Name";
});
Result is :
"requestBody": {
"x-name": "new Name",
"content": {
"application/json": {
}
}
}
Expected behavior
Expected keeping content type or refuse updating / throw exception as manipulation is considered as a nonsense or not allowed this way.
/!\ Notice than when using Operation.RequestBody instead of parameter entry the behavior doesn't exists.
Hope this will help progressing of this wonderfull tool that is nswag.
Best regards.