requesthandler: Echo request details in response of CallVendorRequest

I generally don't like to echo data provided to obs-websocket in
requests, but since we do that for the request type in base requests,
this particular case seems fair.

Closes #919
This commit is contained in:
tt2468 2022-07-02 07:09:31 -07:00
parent 6122fe6ea7
commit be1b13f15d

View File

@ -140,6 +140,8 @@ RequestResult RequestHandler::BroadcastCustomEvent(const Request &request)
* @requestField requestType | String | The request type to call
* @requestField ?requestData | Object | Object containing appropriate request data | {}
*
* @responseField vendorName | String | Echoed of `vendorName`
* @responseField requestType | String | Echoed of `requestType`
* @responseField responseData | Object | Object containing appropriate response data. {} if request does not provide any response data
*
* @requestType CallVendorRequest
@ -187,6 +189,8 @@ RequestResult RequestHandler::CallVendorRequest(const Request &request)
}
json responseData;
responseData["vendorName"] = vendorName;
responseData["requestType"] = requestType;
responseData["responseData"] = Utils::Json::ObsDataToJson(obsResponseData);
return RequestResult::Success(responseData);