Skip to content

Commit

Permalink
Swagger definitions now have type set to object.
Browse files Browse the repository at this point in the history
While the spec does not seem to require this, the Swagger editor at
http://editor.swagger.io/ gets confused and does not display the
'Try this operation' UI correctly.

Many of the examples found around also specify `"type": "object"`,
so this *should* be the right thing to do.
  • Loading branch information
ivucica committed Apr 16, 2016
1 parent 965b62d commit a8a4151
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions protoc-gen-swagger/genswagger/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func findNestedMessagesAndEnumerations(message *descriptor.Message, reg *descrip
func renderMessagesAsDefinition(messages messageMap, d swaggerDefinitionsObject, reg *descriptor.Registry) {
for _, msg := range messages {
object := swaggerSchemaObject{
Type: "object",
Properties: map[string]swaggerSchemaObject{},
}
for _, field := range msg.Fields {
Expand Down

0 comments on commit a8a4151

Please sign in to comment.