- 
                Notifications
    You must be signed in to change notification settings 
- Fork 111
Closed
Labels
info: workaround availableA workaround is available for the issueA workaround is available for the issuetype: bugSomething isn't workingSomething isn't working
Description
Thanks for reporting an issue, please review the task list below before submitting the
issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.
NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.
Task List
- Steps to reproduce provided
- Stacktrace (if present) provided
- Example that reproduces the problem uploaded to Github
- Full description of the issue provided (see below)
Steps to Reproduce
- Create a Post API with a single parameter and without any request body
    @Post(
            uri = "/upload/{id}",
            produces = [MediaType.APPLICATION_JSON]
    )
    fun upload(
            id: String,
    ) {
        print("Do nothing")
    }
- Generate the OpenAPI YAML
Expected Behaviour
API should look like this:
  /v1/repro/upload/{id}:
    post:
      tags:
        - 'ReproController '
      summary: summary
      description: desc
      operationId: id2
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
Actual Behaviour
requestBody is added
  /v1/repro/upload/{id}:
    post:
      tags:
        - 'ReproController '
      summary: summary
      description: desc
      operationId: id2
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
        required: true
Environment Information
- Operating System: MacOS X
- Micronaut Version: 2.2.0
- JDK Version: 1.8
Example Application
https://github.com/andyndang/micronaut-swagger-yml-bug/tree/89b20c9451f333e8fb17678cff0ca6ac063a415f
jaecktec, swaechter, kevin-wise, Panthaaaa, morki and 2 more
Metadata
Metadata
Assignees
Labels
info: workaround availableA workaround is available for the issueA workaround is available for the issuetype: bugSomething isn't workingSomething isn't working