Anypoint Best Practices
request-response-antipattern
general > request-response-antipattern
Guidance
Resource schemas should describe the information of the exposed resource, not a Request/Response RPC message wrapper containing the resource and out-of-band information. For example instead of using a schema like `MyResourceRequest` or `MyResourceResponse` use `MyResource`.
Message
'{{shacl.name}}' is using the request/response anti-pattern.
Examples
valid
/endpoint:
get:
body:
application/json:
type: Person
responses:
200:
body:
application/json:
type: Person
invalid
/endpoint:
get:
body:
application/json:
type: PersonRequest
responses:
200:
body:
application/json:
type: PersonResponse # this is an anti-pattern
Applies to NodeShape