You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Swashbuckle.AspNetCore 6.5.0 with Swashbuckle.AspNetCore.Annotations 6.5.0 and have added a SwaggerRequestBodyAttribute to a response class thus:
app.MapPost("/todos",([FromBody,SwaggerRequestBody("Todo object to be created",Required=true)]Todotodo)=>{todos.Add(todowith{Id=Guid.NewGuid()});returnTypedResults.Ok(todo);}).WithOpenApi(operation =>new(operation){Summary="Create a todo",OperationId="createTodo",Tags=newList<OpenApiTag>{new(){Name="Todos"}},//Parameters = new List<OpenApiParameter>//{// new OpenApiParameter{ Description ="Todo object to be created" }//}});
The project docs say I can use this to "to enrich the corresponding Schema metadata that's generated by Swashbuckle", but the generated swagger.json doesn't contain "MyTitle" or "MyDescription" at all, only:
I have just written a PR because it was giving an exception for this matter. @martincostello this parameter is to describe the RequestBody, not the operation itself
Minimal API
I'm using Swashbuckle.AspNetCore 6.5.0 with Swashbuckle.AspNetCore.Annotations 6.5.0 and have added a SwaggerRequestBodyAttribute to a response class thus:
The project docs say I can use this to "to enrich the corresponding Schema metadata that's generated by Swashbuckle", but the generated swagger.json doesn't contain "MyTitle" or "MyDescription" at all, only:
My configurations
The text was updated successfully, but these errors were encountered: