From 9f3f424052c7db0e92147ab0805b329c2d3932a2 Mon Sep 17 00:00:00 2001 From: Christian Boitel Date: Mon, 1 Aug 2022 17:17:06 +0200 Subject: [PATCH] fix #482: add support for integer values additionally to floats --- openapi3/schema.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openapi3/schema.go b/openapi3/schema.go index a2179865f..cf82f0941 100644 --- a/openapi3/schema.go +++ b/openapi3/schema.go @@ -814,6 +814,12 @@ func (schema *Schema) visitJSON(settings *schemaValidationSettings, value interf switch value := value.(type) { case bool: return schema.visitJSONBoolean(settings, value) + case int: + return schema.visitJSONNumber(settings, float64(value)) + case int32: + return schema.visitJSONNumber(settings, float64(value)) + case int64: + return schema.visitJSONNumber(settings, float64(value)) case float64: return schema.visitJSONNumber(settings, value) case string: