Skip to content

Commit 3872e99

Browse files
committed
document additional parameter
1 parent 88919cd commit 3872e99

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,25 @@ the processor will use `java.time.ZonedDateTime` as java type for **all** parame
100100
**all** endpoints that have a "date" parameter.
101101

102102
In the example both endpoints would use `java.time.ZonedDateTime` as java type for the "date" parameter.
103+
104+
== additional parameter
105+
106+
It is possible to add additional parameters that is not described in the OpenAPI. For example `HttpServletRequest` which may be needed to get something from the request that is not described in the api.
107+
108+
While it is possible to add it at the global level, it is best used at the endpoint level.
109+
110+
[source,yaml]
111+
----
112+
openapi-processor-mapping: v12
113+
114+
options:
115+
package-name: generated
116+
117+
map:
118+
paths:
119+
/foo:
120+
parameters:
121+
- add: request => javax.servlet.http.HttpServletRequest
122+
----
123+
124+
This will add a parameter `request` to the endpoint method.

0 commit comments

Comments
 (0)