]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stats: fix validity of the json schema
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 2 Oct 2020 16:31:59 +0000 (18:31 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 5 Oct 2020 07:06:06 +0000 (09:06 +0200)
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.

src/stats.c

index 38cac0cb93008b0ca18d163cf151e87ebd11e8fd..c306bfcef3c267614f90d00254e8d9d04df6809d 100644 (file)
@@ -3579,9 +3579,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\"},"
@@ -3626,9 +3626,9 @@ static void stats_dump_json_schema(struct buffer *out)
                        "\"properties\":{"
                         "\"errorStr\":{"
                          "\"type\":\"string\""
-                        "},"
-                        "\"required\":[\"errorStr\"]"
-                       "}"
+                        "}"
+                       "},"
+                       "\"required\":[\"errorStr\"]"
                       "}"
                      "],"
                      "\"definitions\":{"