From 7d95eda1b680eb3b6987f3d204bc05af20830229 Mon Sep 17 00:00:00 2001 From: dongwenze Date: Thu, 16 Mar 2023 18:02:02 +0800 Subject: [PATCH] =?UTF-8?q?OCT=201.=E6=9B=B4=E6=94=B9JSON=E8=A7=84?= =?UTF-8?q?=E8=8C=83=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srcs/libs/protocol/protocol.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/srcs/libs/protocol/protocol.c b/srcs/libs/protocol/protocol.c index c024e91..d0044d7 100644 --- a/srcs/libs/protocol/protocol.c +++ b/srcs/libs/protocol/protocol.c @@ -30,10 +30,14 @@ typedef struct { } JSON_SCHEMA_CTX, *PJSON_SCHEMA_CTX; static JSON_SCHEMA_CTX g_json_sch[] = { - {"{\"type\":\"object\",\"required\":[\"ver\"],\"properties\":{\"ver\":{\"type\":\"integer\"}}}", "Incorrect field [ver]"}, - {"{\"type\":\"object\",\"required\":[\"cryptoType\"],\"properties\":{\"cryptoType\":{\"type\":\"integer\",\"minimum\":0,\"maximum\":4}}}", "Incorrect field [cryptoType]"}, - {"{\"type\":\"object\",\"required\":[\"timeStamp\"],\"properties\":{\"timeStamp\":{\"type\":\"integer\"}}}", "Incorrect field [timeStamp]"}, - {"{\"type\":\"object\",\"required\":[\"msgContent\"]}", "Missing required field [msgContent]"}, + {"{\"type\":\"object\",\"required\":[\"ver\"]}", "Missing required field [ver]" }, + {"{\"type\":\"object\",\"required\":[\"cryptoType\"]}", "Missing required field [cryptoType]" }, + {"{\"type\":\"object\",\"required\":[\"timeStamp\"]}", "Missing required field [timeStamp]" }, + {"{\"type\":\"object\",\"required\":[\"msgContent\"]}", "Missing required field [msgContent]" }, + {"{\"properties\":{\"ver\":{\"type\":\"integer\"}}}", "[ver] should be an integer value" }, + {"{\"properties\":{\"cryptoType\":{\"type\":\"integer\"}}}", "[cryptoType] should be an integer value"}, + {"{\"properties\":{\"cryptoType\":{\"minimum\":0,\"maximum\":4}}}", "Undefined type in field [cryptoType]" }, + {"{\"properties\":{\"timeStamp\":{\"type\":\"integer\"}}}", "[timeStamp] should be an integer value" }, }; const char *proto_schema_validation(const char *pJsonStr) {