-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
According to OpenApi 3.0 spec "reusable request bodies" are supported. However with latest NSwag (version 13.3.0.0) controllers are not generated correctly - action argument is always of type 'object':
openapi: '3.0.0'
paths:
/bugs:
post:
summary: Returns list on NSwagStudio bugs
requestBody:
$ref: "#/components/requestBodies/NSwagStudioBug"
responses:
'200':
$ref: '#/components/responses/NoContent'
components:
requestBodies:
description: Describes NSwagStudio bug
required: true
content:
application/json:
schema:
type: string
responses:
NoContent:
description: No contentand here is the generated code generated for action:
[Microsoft.AspNetCore.Mvc.HttpPost, Microsoft.AspNetCore.Mvc.Route("bugs")]
public System.Threading.Tasks.Task Bugs([Microsoft.AspNetCore.Mvc.FromBody] object body)
{
return _implementation.BugsAsync(body);
}Expected: body type should be 'string'.
liesahead, JordyThien and boyarincev
Metadata
Metadata
Assignees
Labels
No labels