Skip to content

Commit

Permalink
fix getkin#482: add support for integer values additionally to floats
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Boitel committed Aug 1, 2022
1 parent a544d6f commit ae4632f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions openapi3/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ae4632f

Please sign in to comment.