Skip to content

Commit

Permalink
Allow multiple types to be specified for parameters using comma seper…
Browse files Browse the repository at this point in the history
…ation e.g. 'string,integer'
  • Loading branch information
miketonks committed Sep 27, 2018
1 parent 6608dda commit af4ad65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions swag-validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func SwaggerValidator(api *swagger.API) gin.HandlerFunc {
p.Options,
p.Trace,
p.Connect} {
if e != nil {
if e != nil && e.Handler != nil {
schema := buildRequestSchema(e)
schema.Definitions = buildSchemaDefinitions(api)
schemaLoader := gojsonschema.NewGoLoader(schema)
Expand Down Expand Up @@ -305,7 +305,7 @@ func buildSchemaDefinitions(api *swagger.API) map[string]SchemaDefinition {
}
for k, p := range d.Properties {
sp := SchemaProperty{
Type: []string{p.Type},
Type: strings.Split(p.Type, ","),
Description: p.Description,
Enum: p.Enum,
Format: p.Format,
Expand Down

0 comments on commit af4ad65

Please sign in to comment.