You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a model or response includes a field whose type is another model. Adding a comment to that field won't result in a description field when running generate spec -m -o swagger.yaml
Steps to reproduce
In this example anotherModel includes a field that references someModel
package go_swagger_example
// This is some model// swagger:modeltypesomeModelstruct {
// The name of a thingNamestring`json:"name"`// The ID of a thingIDint`json:"id"`
}
// This is another model// swagger:modeltypeanotherModelstruct {
// The name of another thingNamestring`json:"name"`// This model sometimes includes another modelSomeModel*someModel`json:"model"`
}
definitions:
anotherModel:
description: This is another modelproperties:
model:
$ref: '#/definitions/someModel'name:
description: The name of another thingtype: stringx-go-name: Nametype: objectx-go-package: go-swagger-examplesomeModel:
description: This is some modelproperties:
id:
description: The ID of a thingformat: int64type: integerx-go-name: IDname:
description: The name of a thingtype: stringx-go-name: Nametype: objectx-go-package: go-swagger-examplepaths: {}swagger: "2.0"
There is no description on the model field for anotherModel
Environment
swagger version: v0.30.5
go version: 1.21
OS: darwin
The text was updated successfully, but these errors were encountered:
Problem statement
If a model or response includes a field whose type is another model. Adding a comment to that field won't result in a description field when running
generate spec -m -o swagger.yaml
Steps to reproduce
In this example
anotherModel
includes a field that referencessomeModel
Running
swagger generate spec -o swagger.yaml -m
produces:There is no description on the
model
field foranotherModel
Environment
swagger version: v0.30.5
go version: 1.21
OS: darwin
The text was updated successfully, but these errors were encountered: