-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Problem statement
If a response contains a reference to a model, and the field in the response has a comment, that comment is ignored and not included as a description.
Swagger specification
responses:
CreateUserResponse:
description: ""
schema:
properties:
error:
description: An error message describing what went wrong
type: string
user:
# Missing description field
$ref: '#/definitions/User'
type: object
Steps to reproduce
// swagger:model
type User struct {
ID int64 `json:"id"`
Email string `json:"email"`
}
// swagger:response
type CreateUserResponse struct {
// in: body
Body struct {
// An error message describing what went wrong
Error string `json:"error,omitempty"`
// The created user
User User `json:"user"`
}
}
swagger generate spec -o ./swagger.yml
Environment
swagger version: v0.29.0
go version: go1.18 linux/amd64
OS: Pop!_OS 21.04
Metadata
Metadata
Assignees
Labels
No labels