|
| 1 | +## |
| 2 | +## mapping example with keys & values |
| 3 | +## |
| 4 | + |
| 5 | +# mapping format [required] |
| 6 | +openapi-processor-mapping: v8 |
| 7 | + |
| 8 | +options: # general processor options [required] |
| 9 | + |
| 10 | + # target package [required]: io.openapiprocessor.generated (default) |
| 11 | + package-name: io.openapiprocessor.generated |
| 12 | + |
| 13 | + # validation annotation (optional): true or false (default), javax, jakarta. |
| 14 | + bean-validation: jakarta |
| 15 | + |
| 16 | + # generate javadoc from OpenAPI 'description' properties. |
| 17 | + javadoc: true |
| 18 | + |
| 19 | + # enable/disable code formatter: true (default) or false. |
| 20 | + format-code: false |
| 21 | + |
| 22 | + # suffix for model class names and enum names. Default is none. |
| 23 | + model-name-suffix: Resource |
| 24 | + |
| 25 | + # default (i.e pojo) or record |
| 26 | + model-type: default |
| 27 | + |
| 28 | + # default, string, supplier |
| 29 | + enum-type: default |
| 30 | + |
| 31 | + # generate common interface for an `oneOf` object list (optional): true or false (default) |
| 32 | + one-of-interface: true |
| 33 | + |
| 34 | + # enable/disable deletion of targetDir: true (default) or false. |
| 35 | + clear-target-dir: false |
| 36 | + |
| 37 | + # enable/disable @Generated annotation |
| 38 | + generated-annotation: true |
| 39 | + |
| 40 | + # enable/disable date on @Generated annotation |
| 41 | + generated-date: true |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +compatibility: |
| 46 | + bean-validation-valid-on-reactive: false |
| 47 | + identifier-word-break-from-digit-to-letter: false |
| 48 | + |
| 49 | +map: # the type mappings |
| 50 | + |
| 51 | + # global mappings, apply to all paths/endpoints |
| 52 | + |
| 53 | + # response wrapper (optional) |
| 54 | + result: org.springframework.http.ResponseEntity |
| 55 | + |
| 56 | + # result style (optional, default "success") |
| 57 | + result-style: all |
| 58 | + |
| 59 | + # reactive single wrapper (optional) |
| 60 | + single: reactor.core.publisher.Mono |
| 61 | + |
| 62 | + # reactive array wrapper (optional) |
| 63 | + multi: reactor.core.publisher.Flux |
| 64 | + |
| 65 | + types: # global type mappings (optional) |
| 66 | + |
| 67 | + - type: array => java.util.Collection |
| 68 | + |
| 69 | + - type: Schema => java.util.Map |
| 70 | + generics: |
| 71 | + - java.lang.String |
| 72 | + - java.lang.Double |
| 73 | + |
| 74 | + - type: Schema @ io.openapiprocessor.Annotation() |
| 75 | + |
| 76 | + parameters: # global parameter mappings (optional) |
| 77 | + |
| 78 | + - name: foo => java.util.List |
| 79 | + - name: bar => com.github.hauner.openapi.Bar |
| 80 | + - name: param @ io.openapiprocessor.Annotation() |
| 81 | + - type: Schema @ io.openapiprocessor.Annotation() |
| 82 | + |
| 83 | + responses: # global response mappings (optional) |
| 84 | + |
| 85 | + - content: application/vnd.something => java.util.List |
| 86 | + - content: application/json => com.github.hauner.openapi.FooBar |
| 87 | + |
| 88 | + |
| 89 | + paths: # path/endpoint specific mappings (optional) |
| 90 | + |
| 91 | + /first: # a path/endpoint from the openapi.yaml |
| 92 | + |
| 93 | + # generate endpoint to a separate "excluded" interface |
| 94 | + exclude: true |
| 95 | + |
| 96 | + /second: # another path/endpoint from the openapi.yaml |
| 97 | + |
| 98 | + # path mappings, allow the same mappings as on the global level (except the "paths" property) |
| 99 | + # all mappings apply only to the parent path overriding any matching global mapping |
| 100 | + |
| 101 | + # override top level "result" property, "plain" means no wrapper |
| 102 | + result: plain |
| 103 | + single: reactor.core.publisher.Mono |
| 104 | + multi: reactor.core.publisher.Flux |
| 105 | + |
| 106 | + types: |
| 107 | + - type: Schema => java.util.Collection |
| 108 | + |
| 109 | + parameters: |
| 110 | + - name: foo => java.util.List |
| 111 | + - add: bar => java.util.Set |
| 112 | + - type: Schema @ io.openapiprocessor.Annotation() |
| 113 | + |
| 114 | + responses: |
| 115 | + - content: application/vnd.any => java.util.Set |
| 116 | + - content: application/json => java.util.Map |
| 117 | + |
| 118 | + /third: |
| 119 | + result: plain |
| 120 | + |
| 121 | + # path mappings can be limited to a specific http method |
| 122 | + |
| 123 | + patch: |
| 124 | + # path method mappings, allow the same mappings as on the global level (except the "paths" property) |
| 125 | + # all mappings apply only to the parent path and method overriding any matching global mapping |
| 126 | + |
| 127 | + null: org.openapitools.jackson.nullable.JsonNullable = JsonNullable.undefined() |
| 128 | + |
| 129 | + extensions: |
| 130 | + x-something: foo @ some.Annotation |
| 131 | + x-something-else: |
| 132 | + - foo @ some.custom.FooAnnotation |
| 133 | + - bar @ some.custom.BarAnnotation |
0 commit comments