Skip to content

Commit 51481b2

Browse files
committed
update docs
1 parent 4c55208 commit 51481b2

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

docs/modules/ROOT/pages/mapping/result.adoc

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
= Result mapping
22
include::partial$links.adoc[]
33

4+
== Standard
5+
46
A link:{spring-responseentity}[`ResponseEntity<>`] allows an endpoint implementation full control of the response.
57

68
Here is a super simple example:
@@ -12,7 +14,7 @@ public ResponseEntity<String> getFoo() {
1214
}
1315
----
1416

15-
To enable a result wrapper set the `result` mapping in the mapping yaml to a fully qualified java type.
17+
To enable a result wrapper set the `result` mapping in the mapping YAML to a fully qualified java type.
1618

1719
[source,yaml]
1820
----
@@ -34,8 +36,29 @@ Depending on the number of defined response content types the parameter of the `
3436
|`ResponseEntity<?>`
3537
|===
3638

37-
NOTE: prior to 1.0.0.M13 all results were auto-wrapped with `ResponseEntity<>`.
39+
== plain result type
40+
41+
[.badge .badge-since]+since 2025.5+
42+
43+
The **standard** `result` mapping requires a generic wrapper type, like `ResponseEntity<>`. To map a non-generic type as return type the `result` mapping accepts an *arrow mapping*:
44+
45+
`plain => {target type}`
46+
47+
which means, instead of the plain schema described in the OpenAPI response, use the `target type` as endpoint return type.
3848

49+
[source,yaml,subs=attributes+]
50+
----
51+
openapi-processor-mapping: {var-mapping-version}
52+
53+
options:
54+
package-name: io.openapiprocessor.generated
55+
56+
map:
57+
paths:
58+
/foo:
59+
# new, mapping of plain replacement type
60+
result: plain => org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody
61+
----
3962

4063
== Limit to Endpoint
4164

docs/modules/ROOT/pages/processor/configuration.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ options:
1919
package-name-from-path: true
2020
model-name-suffix: Resource
2121
model-type: record
22+
model-unreferenced: false
2223
enum-type: string
2324
one-of-interface: true
2425
bean-validation: jakarta
@@ -311,6 +312,14 @@ public class Foo {
311312
}
312313
----
313314

315+
=== model-unreferenced ([.badge .badge-since]+new with 2025.5+)
316+
317+
**optional** (boolean, `true` or `false`, default is `false`)
318+
319+
enables generation of unreferenced `component/schemas`. A schema is unreferenced if it is not used in any endpoint description.
320+
321+
By default, openapi-processor will only generate DTOs for schemas that are referenced by an endpoint.
322+
314323
=== bean-validation
315324

316325
**optional** (boolean or string, `true` or `false`, `javax`, `jakarta`, default is `false`)

0 commit comments

Comments
 (0)