Closed cjea closed 3 years ago
@ellensartorelli @cjea
You can actually specify the response body for actions.
Here's an example from the Asset Permissioning Spec we're working on:
This Reslang generates an endpoint with the path /v1/policies/actions/check
:
sync bulk action Policy::Check {
orgID: string
asset: Asset
operation: OperationType
/operations
POST
"Result of the policy check, including allowed or denied." 200 PolicyCheckResponse
}
structure PolicyCheckResponse {
allowed: boolean
metadata: stringmap<string>
denyReasons: string[]
}
The generated response body looks like this (copied this from the Response Samples
in the Swagger UI):
{
"allowed": true,
"metadata": {
"property1": "string",
"property2": "string"
},
"denyReasons": [
"string"
]
}
Source (@ellensartorelli FYI)
Description
Response bodies from "actions" routes should be customizable, as opposed to being locked in to the last part of the URL path (details in document linked above)
Value provided
More control for teams in determining the shape of their response body, ability to override the default if necessary