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