mapping.v7.mapping.example.yaml Maven / Gradle / Ivy
##
## mapping example with keys & values
##
# mapping format [required]
openapi-processor-mapping: v7
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
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