1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00
falk-werner_webfuse-provider/lib/webfuse_provider/impl/jsonrpc/request.c

18 lines
626 B
C
Raw Normal View History

2020-06-16 21:39:45 +00:00
#include "webfuse_provider/impl/jsonrpc/request.h"
#include "webfuse_provider/impl/json/node.h"
#include <stdlib.h>
2019-02-09 02:08:02 +00:00
2020-02-29 01:32:03 +00:00
bool
wfp_jsonrpc_is_request(
struct wfp_json const * message)
{
if (NULL == message) { return false; }
struct wfp_json const * id = wfp_impl_json_object_get(message, "id");
struct wfp_json const * method = wfp_impl_json_object_get(message, "method");
struct wfp_json const * params = wfp_impl_json_object_get(message, "params");
return (wfp_impl_json_is_int(id) && wfp_impl_json_is_string(method) &&
(wfp_impl_json_is_array(params) || wfp_impl_json_is_object(params)));
2019-02-09 02:08:02 +00:00
}