Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !10366

[Kotlin-spring] fix default value for @ApiParam

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/galeries-lafayette/fix/default-string-value into master Sep 10, 2021
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: frecco75

This PR fixes default value for String into @ApiParam.

For example given this schema :

openapi: "3.0.1"
info:
  version: 1.0.0
  title: Users

paths:
  /users/search:
    post:
      parameters:
        - name: name
          in: header
          description: The name of the user
          schema:
            type: string
            default: "bond"
      responses:
        default:
          description: ""

The generator without the fix produces this code which doesn't compile because of invalid defaultValue attribute

    fun usersSearchPost(@ApiParam(value = "The name of the user" , defaultValue=""bond"") @RequestHeader(value="name", required=false) name: kotlin.String
): ResponseEntity<Unit>

with the fix it compiles correctly

fun usersSearchPost(@ApiParam(value = "The name of the user" , defaultValue="bond") @RequestHeader(value="name", required=false) name: kotlin.String
): ResponseEntity<Unit>
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/galeries-lafayette/fix/default-string-value