Result mapping
A ResponseEntity<>
allows an endpoint implementation full control of
the response.
Here is a super simple examples:
public ResponseEntity<String> getFoo() {
return ResponseEntity.ok("foo");
}
To enable a result wrapper set the result
mapping in the mapping yaml to a fully qualified java
type.
map:
result: org.springframework.http.ResponseEntity
The processor expects that it takes a single generic parameter. |
Depending on the number of defined response content types the parameter of the ResponseEntity<>
will be either the java type or the unknown type.
responses | ResponseEntity<> |
---|---|
one |
|
multiple |
|
prior to 1.0.0.M13 all results were auto-wrapped with ResponseEntity<> .
|