From 3f56d6b282d0965d124d6b6f1c6119673022a695 Mon Sep 17 00:00:00 2001 From: Graham Esau Date: Wed, 30 Oct 2019 19:34:05 +0000 Subject: [PATCH] Give unsigned int schemas explicit minimum value Update tests --- schemars/tests/expected/schema-openapi3.json | 12 +++++++ schemars/tests/expected/schema.json | 36 +++++++++++++------- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/schemars/tests/expected/schema-openapi3.json b/schemars/tests/expected/schema-openapi3.json index 5708360..2746c84 100644 --- a/schemars/tests/expected/schema-openapi3.json +++ b/schemars/tests/expected/schema-openapi3.json @@ -139,16 +139,19 @@ "maxItems": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "maxLength": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "maxProperties": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "maximum": { @@ -159,16 +162,19 @@ "minItems": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "minLength": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "minProperties": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "minimum": { @@ -424,16 +430,19 @@ "maxItems": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "maxLength": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "maxProperties": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "maximum": { @@ -444,16 +453,19 @@ "minItems": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "minLength": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "minProperties": { "type": "integer", "format": "uint32", + "minimum": 0.0, "nullable": true }, "minimum": { diff --git a/schemars/tests/expected/schema.json b/schemars/tests/expected/schema.json index 1fabd53..9ba6963 100644 --- a/schemars/tests/expected/schema.json +++ b/schemars/tests/expected/schema.json @@ -148,21 +148,24 @@ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "maxLength": { "type": [ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "maxProperties": { "type": [ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "maximum": { "type": [ @@ -176,21 +179,24 @@ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "minLength": { "type": [ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "minProperties": { "type": [ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "minimum": { "type": [ @@ -457,21 +463,24 @@ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "maxLength": { "type": [ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "maxProperties": { "type": [ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "maximum": { "type": [ @@ -485,21 +494,24 @@ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "minLength": { "type": [ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "minProperties": { "type": [ "integer", "null" ], - "format": "uint32" + "format": "uint32", + "minimum": 0.0 }, "minimum": { "type": [