Skip to content

Commit 9f3f424

Browse files
author
Christian Boitel
committed
fix #482: add support for integer values additionally to floats
1 parent b1ab4f4 commit 9f3f424

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

openapi3/schema.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,12 @@ func (schema *Schema) visitJSON(settings *schemaValidationSettings, value interf
814814
switch value := value.(type) {
815815
case bool:
816816
return schema.visitJSONBoolean(settings, value)
817+
case int:
818+
return schema.visitJSONNumber(settings, float64(value))
819+
case int32:
820+
return schema.visitJSONNumber(settings, float64(value))
821+
case int64:
822+
return schema.visitJSONNumber(settings, float64(value))
817823
case float64:
818824
return schema.visitJSONNumber(settings, value)
819825
case string:

0 commit comments

Comments
 (0)