OCT 1.更改JSON规范格式
This commit is contained in:
parent
65cb52e156
commit
7d95eda1b6
|
@ -30,10 +30,14 @@ typedef struct {
|
||||||
} JSON_SCHEMA_CTX, *PJSON_SCHEMA_CTX;
|
} JSON_SCHEMA_CTX, *PJSON_SCHEMA_CTX;
|
||||||
|
|
||||||
static JSON_SCHEMA_CTX g_json_sch[] = {
|
static JSON_SCHEMA_CTX g_json_sch[] = {
|
||||||
{"{\"type\":\"object\",\"required\":[\"ver\"],\"properties\":{\"ver\":{\"type\":\"integer\"}}}", "Incorrect field [ver]"},
|
{"{\"type\":\"object\",\"required\":[\"ver\"]}", "Missing required field [ver]" },
|
||||||
{"{\"type\":\"object\",\"required\":[\"cryptoType\"],\"properties\":{\"cryptoType\":{\"type\":\"integer\",\"minimum\":0,\"maximum\":4}}}", "Incorrect field [cryptoType]"},
|
{"{\"type\":\"object\",\"required\":[\"cryptoType\"]}", "Missing required field [cryptoType]" },
|
||||||
{"{\"type\":\"object\",\"required\":[\"timeStamp\"],\"properties\":{\"timeStamp\":{\"type\":\"integer\"}}}", "Incorrect field [timeStamp]"},
|
{"{\"type\":\"object\",\"required\":[\"timeStamp\"]}", "Missing required field [timeStamp]" },
|
||||||
{"{\"type\":\"object\",\"required\":[\"msgContent\"]}", "Missing required field [msgContent]"},
|
{"{\"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) {
|
const char *proto_schema_validation(const char *pJsonStr) {
|
||||||
|
|
Loading…
Reference in New Issue