Skip to content

Commit

Permalink
provide example and enum values when reporting unsupported type (#921)
Browse files Browse the repository at this point in the history
Improve debug messages
  • Loading branch information
vyskocilm committed Aug 3, 2021
1 parent 4dda7e3 commit f2f643a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion operation.go
Expand Up @@ -474,7 +474,7 @@ func defineType(schemaType string, value string) (interface{}, error) {
}
return v, nil
default:
return nil, fmt.Errorf("%s is unsupported type in enum value", schemaType)
return nil, fmt.Errorf("%s is unsupported type in enum value %s", schemaType, value)
}
}

Expand Down
4 changes: 2 additions & 2 deletions parser.go
Expand Up @@ -1297,7 +1297,7 @@ func defineTypeOfExample(schemaType, arrayType, exampleValue string) (interface{
return result, nil
case OBJECT:
if arrayType == "" {
return nil, fmt.Errorf("%s is unsupported type in example value", schemaType)
return nil, fmt.Errorf("%s is unsupported type in example value `%s`", schemaType, exampleValue)
}

values := strings.Split(exampleValue, ",")
Expand All @@ -1317,7 +1317,7 @@ func defineTypeOfExample(schemaType, arrayType, exampleValue string) (interface{
}
return result, nil
default:
return nil, fmt.Errorf("%s is unsupported type in example value", schemaType)
return nil, fmt.Errorf("%s is unsupported type in example value %s", schemaType, exampleValue)
}
}

Expand Down

0 comments on commit f2f643a

Please sign in to comment.