You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/processor/configuration.adoc
+74-10Lines changed: 74 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ A mapping yaml looks like this:
9
9
10
10
[source,yaml]
11
11
----
12
-
openapi-processor-mapping: v9
12
+
openapi-processor-mapping: v11
13
13
14
14
options:
15
15
package-name: io.openapiprocessor.sample
@@ -60,7 +60,7 @@ Interfaces and models will be generated into the `api` and `model` subpackages o
60
60
61
61
[source,yaml]
62
62
----
63
-
openapi-processor-mapping: v9
63
+
openapi-processor-mapping: v11
64
64
65
65
options:
66
66
package-name: io.openapiprocessor.sample
@@ -117,7 +117,7 @@ components:
117
117
*mapping.yaml*
118
118
[source,yaml]
119
119
----
120
-
openapi-processor-mapping: v8
120
+
openapi-processor-mapping: v11
121
121
122
122
options:
123
123
package-name: io.openapiprocessor.sample
@@ -160,7 +160,7 @@ public class BarResource { // <4>
160
160
161
161
=== model-type
162
162
163
-
*optional** (string, `default` or `record`, default is `default`)
163
+
**optional** (string, `default` or `record`, default is `default`)
164
164
165
165
generate pojos (class with get/set property methods) or records model classes from OpenAPI schemas. This is a global setting in the `mapping.yaml`. It can either have the value `default` (which is default) to generate pojos or `record` to generate records.
166
166
@@ -169,7 +169,7 @@ generate pojos (class with get/set property methods) or records model classes fr
169
169
*mapping.yaml*
170
170
[source,yaml]
171
171
----
172
-
openapi-processor-mapping: v9
172
+
openapi-processor-mapping: v11
173
173
174
174
options:
175
175
model-type: record
@@ -219,6 +219,56 @@ public class Foo {
219
219
}
220
220
----
221
221
222
+
=== model-accessors ([.badge .badge-since]+new with 2025.1+)
223
+
224
+
**optional** (boolean, `true` or `false`, default is `true`)
225
+
226
+
enables or disables generation of accessor methods, i.e. getter and setter. The properties are still private. This is only useful in combination with an object annotation mapping that adds the accessors. For example `lombok.Getter` & `lombok.Setter`.
227
+
228
+
[NOTE]
229
+
This is only used with `model-type: default`. It is ignored with `model-type: record`.
230
+
231
+
==== example
232
+
233
+
Here is a small example that uses object annotation mapping to add the lombok getter and setter annotations to the generated class.
234
+
235
+
[source,yaml]
236
+
----
237
+
openapi-processor-mapping: v11
238
+
239
+
options:
240
+
package-name: generated
241
+
model-type: default # i.e. pojo
242
+
model-accessors: false # only used if model-type is default
243
+
244
+
map:
245
+
types:
246
+
- type: object @ lombok.Getter
247
+
- type: object @ lombok.Setter
248
+
----
249
+
250
+
The generated schema class is then looks like this, with annotations and without accessor methods.
0 commit comments