Merge pull request #5906 from jsangmeister/fix-action-interface

Fix action interface
This commit is contained in:
jsangmeister 2021-02-26 12:39:06 +01:00 committed by GitHub
commit cf349840fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,18 +45,27 @@ interace ActionsResponse {
*
* To report errors, use the ActionError format!
**/
results: ((object | ActionError | null)[] | null )[]
results: (object[] | ActionError | null )[]
}
/**
* If action_data_error_index is given, the error can be directly associated with the
* respective action data. If not, the error is of general fashion and/or not directly
* associated with a single action data.
*
* Note: ActionError can only be used if atomic=true.
*/
interface ActionError {
success: false;
message: string;
action_data_error_index?: number;
}
/**
* JSON resonse with a status code of !=200. If a specific action raised the error,
* use the action_error_index and action_payload_error_index to indicate the errored
* action and payload. If there were general errors, both indices must be omitted or null.
* use the action_error_index and action_data_error_index to indicate the errored
* action and data, respectively. If there were general errors, both indices must be
* omitted or null.
*
* If the atomic flag was true in the request, it is not allowed to send
* action-specific errors with this exception. It must be responded with an
@ -66,5 +75,5 @@ Exception ActionException {
success: false;
message: string;
action_error_index?: number;
action_payload_error_index?: number;
action_data_error_index?: number;
}