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 21, 2022
1 parent 5d78ae9 commit 1075729
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 @@ -816,6 +816,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 1075729

Please sign in to comment.