From 63c7b2c27cad55e86c20e9e1cdcd0464dcf1e81c Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Fri, 2 Oct 2020 18:31:59 +0200 Subject: [PATCH] BUG/MINOR: stats: fix validity of the json schema The json schema seems to be invalid when checking using the validator from https://www.jsonschemavalidator.net/. Correct it using the following specification : http://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.1 The impact of the bug it not well known as I am not sure of how useful the json schema is for users. It is probably not used at all or else this bug would have been reported. This should be backported up to 1.8. (cherry picked from commit a53ce4cc011250a0e561f4e5bb62f46719813534) Signed-off-by: Christopher Faulet (cherry picked from commit a9299e1f56f65ce89d45690a2356d5f59eed6bdd) Signed-off-by: Christopher Faulet --- src/stats.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/stats.c b/src/stats.c index 94b07eb..2d07e54 100644 --- a/src/stats.c +++ b/src/stats.c @@ -3540,9 +3540,9 @@ static void stats_dump_json_schema(struct buffer *out) "\"title\":\"Info\"," "\"type\":\"array\"," "\"items\":{" + "\"title\":\"InfoItem\"," + "\"type\":\"object\"," "\"properties\":{" - "\"title\":\"InfoItem\"," - "\"type\":\"object\"," "\"field\":{\"$ref\":\"#/definitions/field\"}," "\"processNum\":{\"$ref\":\"#/definitions/processNum\"}," "\"tags\":{\"$ref\":\"#/definitions/tags\"}," @@ -3587,9 +3587,9 @@ static void stats_dump_json_schema(struct buffer *out) "\"properties\":{" "\"errorStr\":{" "\"type\":\"string\"" - "}," - "\"required\":[\"errorStr\"]" - "}" + "}" + "}," + "\"required\":[\"errorStr\"]" "}" "]," "\"definitions\":{" -- 1.7.10.4