-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.The author of this issue needs to respond in order for us to continue investigating this issue.Status: No Recent Activityold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
requestBody in swagger.json of the code below
app.MapPut("/file", Created (HttpRequest request) => {
return TypedResults.Created("https://example.org");
})
.Accepts<byte[]>("application/zip")
.Produces(StatusCodes.Status415UnsupportedMediaType)is
"requestBody": {
"content": {
"application/zip": {
"schema": {
"type": "string",
"format": "byte"
}
}
}
}while .Accepts<Stream>("application/zip")
leads to
"requestBody": {
"content": {
"application/zip": {
"schema": {
"$ref": "#/components/schemas/Stream"
}
}
}
}When I want to override requestBody by adding
.WithOpenApi(o => {
o.RequestBody = new OpenApiRequestBody {
Content = new Dictionary<string, OpenApiMediaType>() {
{
"application/zip",
new OpenApiMediaType {
Schema = new OpenApiSchema {
Type = "string",
Format = "binary"
}
}
}
}
};
return o;
});I find that it has no effect.
How to set format to binary?
.NET Version
7.0.100
Metadata
Metadata
Assignees
Labels
Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.The author of this issue needs to respond in order for us to continue investigating this issue.Status: No Recent Activityold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels