mapping.v10.mapping.example.yaml Maven / Gradle / Ivy
##
## mapping example with keys & values
##
# mapping format [required]
openapi-processor-mapping: v10
options: # general processor options [required]
# target package [required]: io.openapiprocessor.generated (default)
package-name: io.openapiprocessor.generated
# validation annotation (optional): true or false (default), javax, jakarta.
bean-validation: jakarta
# generate javadoc from OpenAPI 'description' properties.
javadoc: true
# enable/disable code formatter: true (default) or false.
format-code: false
# suffix for model class names and enum names. Default is none.
model-name-suffix: Resource
# default (i.e pojo) or record
model-type: default
# default, string, supplier
enum-type: default
# generate common interface for an `oneOf` object list (optional): true or false (default)
one-of-interface: true
# enable/disable deletion of targetDir: true (default) or false.
clear-target-dir: false
# enable/disable @Generated annotation
generated-annotation: true
# enable/disable date on @Generated annotation
generated-date: true
# control @JsonProperty annotation (always|auto|never)
json-property-annotation: always
# target-dir related configuration
target-dir:
clear: true
layout: standard
# server-url related configuration
base-path:
# false, true = 0, 1, ..
prefix: 0
# property resource with the uri base path
properties-name: openapi.properties
logging:
mapping: true
mapping-target: stdout
compatibility:
bean-validation-valid-on-reactive: false
identifier-word-break-from-digit-to-letter: false
map: # the type mappings
# global mappings, apply to all paths/endpoints
# response wrapper (optional)
result: org.springframework.http.ResponseEntity
# result style (optional, default "success")
result-style: all
# reactive single wrapper (optional)
single: reactor.core.publisher.Mono
# reactive array wrapper (optional)
multi: reactor.core.publisher.Flux
types: # global type mappings (optional)
- type: array => java.util.Collection
- type: Schema => java.util.Map
generics:
- java.lang.String
- java.lang.Double
- type: Schema @ io.openapiprocessor.Annotation()
parameters: # global parameter mappings (optional)
- name: foo => java.util.List
- name: bar => com.github.hauner.openapi.Bar
- name: param @ io.openapiprocessor.Annotation()
- type: Schema @ io.openapiprocessor.Annotation()
responses: # global response mappings (optional)
- content: application/vnd.something => java.util.List
- content: application/json => com.github.hauner.openapi.FooBar
paths: # path/endpoint specific mappings (optional)
/first: # a path/endpoint from the openapi.yaml
# generate endpoint to a separate "excluded" interface
exclude: true
/second: # another path/endpoint from the openapi.yaml
# path mappings, allow the same mappings as on the global level (except the "paths" property)
# all mappings apply only to the parent path overriding any matching global mapping
# override top level "result" property, "plain" means no wrapper
result: plain
single: reactor.core.publisher.Mono
multi: reactor.core.publisher.Flux
types:
- type: Schema => java.util.Collection
parameters:
- name: foo => java.util.List
- add: bar => java.util.Set
- type: Schema @ io.openapiprocessor.Annotation()
responses:
- content: application/vnd.any => java.util.Set
- content: application/json => java.util.Map
/third:
result: plain
# path mappings can be limited to a specific http method
patch:
# path method mappings, allow the same mappings as on the global level (except the "paths" property)
# all mappings apply only to the parent path and method overriding any matching global mapping
null: org.openapitools.jackson.nullable.JsonNullable = JsonNullable.undefined()
extensions:
x-something: foo @ some.Annotation
x-something-else:
- foo @ some.custom.FooAnnotation
- bar @ some.custom.BarAnnotation