Christian Benseler
Christian Benseler

Reputation: 8065

Document an Express API POST method with routing-controllers-openapi

I am using routing-controllers-openapi to document an API and I am facing a problem to show the body from a request as parameter in the Swagger UI.

The controller is implemented this way:

@HttpCode(201)
  @OpenAPI({
    description: 'Create a new user'
  })
  @Post('/')
  async newUserAccess(@Body() user: UserAccessDto): Promise<void> {
    await this.service.newUserAccess(user);
  }
}

The Swagger UI shows the UserAccessDto in the example from the parameters but not in the parameter, as de body: enter image description here

I am trying to achieve something like this, in the Pet Store Swagger UI: enter image description here

Anyone knows if this is possible?

Upvotes: 1

Views: 1064

Answers (0)

Related Questions