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
  • !10374

[kotlin-spring] kotlin-builder support

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/galeries-lafayette/feature/kotlin-builder-support into master Sep 10, 2021
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 22

Created by: frecco75

This PR adds the support of KotlinBuilder (See https://github.com/Pozo/mapstruct-kotlin). @KotlinBuilder is interesting when we share models with java projects, because each annotated class will have a corresponding Builder class.

With this PR, each generated model will be annotated with @KotlinBuilder.

Given the schema

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

paths:
  /users:
    get:
      responses:
        200:
          description: users
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'

components:
  schemas:
    User:
      type: object
      required:
        - name
      properties:
        name:
          type: string

When we compile with the option kotlinBuilder=true it generates

@KotlinBuilder data class User(
    @ApiModelProperty(example = "null", required = true, value = "")
    @field:JsonProperty("name", required = true) val name: kotlin.String
)

Note : for the moment the Lombok compiler plugin doesn't support @Builder, so this library is useful

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/galeries-lafayette/feature/kotlin-builder-support