Skip to content

Commit becd5dc

Browse files
committed
add documentation (#412)
1 parent d67c9fc commit becd5dc

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ The full structure of the mapping looks like this (a real mapping file will usua
101101
map:
102102
# global mappings, applies to all paths/endpoints
103103
104+
# x-www-form-urlencoded as object ord destructured parameters
105+
body-style: {object|destructure}
106+
104107
# result wrapper, e.g. org.springframework.http.ResponseEntity
105108
result: {target type}
106109

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

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ map:
118118
- type: string:binary => org.springframework.web.multipart.MultipartFile
119119
----
120120

121-
To upload multiple files we can define the body `object` with an `array` property:
121+
To upload multiple files, we can define the body `object` with an `array` property:
122122

123123
[source,yaml]
124124
----
@@ -183,3 +183,36 @@ paths:
183183
'204':
184184
description: empty
185185
----
186+
187+
=== x-www-form-urlencoded
188+
189+
[.badge .badge-since]+since 2026.2+
190+
191+
the processor does *destructure* an `application/x-www-form-urlencoded` request body. I.e., each of the defined request body properties is passed as a single parameter to the endpoint.
192+
193+
It _destructures_ the request body by default to make it behave like the multipart request described in the previous section.
194+
195+
To receive the request body as a single object parameter, add a `body-style` mapping. `body-style` supports all the usual mapping level, global, endpoint and endpoint method.
196+
197+
[source,yaml,subs=attributes+]
198+
----
199+
map:
200+
# global
201+
body-style: object
202+
#body-style: destructure # default
203+
204+
paths:
205+
/foo:
206+
# endpoint
207+
body-style: object
208+
209+
# endpoint method
210+
# post:
211+
# body-style: object
212+
213+
----
214+
215+
[NOTE]
216+
Currently, the `body-style` mapping is only supported on `application/x-www-form-urlencoded`
217+
218+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
:var-mapping-version: v16
1+
:var-mapping-version: v17
22
:var-openapi-version: 3.1.0

0 commit comments

Comments
 (0)