-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed as duplicate of#60867
Closed as duplicate of#60867
Copy link
Labels
needs-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automaticallyUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
An endpoint which consumes application/form-data is not is mapped to application/x-www-form-urlencoded in the OpenAPI spec:
[HttpPost]
[Consumes("multipart/form-data")]
public IEnumerable<WeatherForecast> Post([FromForm] string name, [FromForm] IFormFile file)
{
...
}
becomes
"paths": {
"/WeatherForecast": {
"post": {
"tags": [
"WeatherForecast"
],
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"allOf": [
{
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},...
Expected Behavior
"paths": {
"/WeatherForecast": {
"post": {
"tags": [
"WeatherForecast"
],
"requestBody": {
"content": {
"application/form-data": {
"schema": {
"type": "object",
"allOf": [
{
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},...
Steps To Reproduce
- Create a new Web-API project
- Add an endpoint in the
WeatherForecastControlleraccording to the problem description - Run the app in debug config
- open
localhost:<port>/openapi/v1.json
Exceptions (if any)
No response
.NET Version
9.0
Anything else?
Microsoft.AspNetCore.OpenApi Version 9.0.8
Metadata
Metadata
Assignees
Labels
needs-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automaticallyUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically