forked from loafle/openapi-generator-original
Merge pull request #2562 from guohuang/issue2548
issue #2548, added docstring to Go model and its properties
This commit is contained in:
commit
fb8c001075
@ -7,8 +7,10 @@ import (
|
||||
)
|
||||
|
||||
{{#model}}
|
||||
{{#description}}// {{{description}}}{{/description}}
|
||||
type {{classname}} struct {
|
||||
{{#vars}}
|
||||
{{#description}}// {{{description}}}{{/description}}
|
||||
{{name}} {{{datatype}}} `json:"{{baseName}},omitempty"`
|
||||
{{/vars}}
|
||||
}
|
||||
|
@ -3,8 +3,12 @@ package swagger
|
||||
import (
|
||||
)
|
||||
|
||||
|
||||
type ApiResponse struct {
|
||||
|
||||
Code int32 `json:"code,omitempty"`
|
||||
|
||||
Type_ string `json:"type,omitempty"`
|
||||
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
@ -3,7 +3,10 @@ package swagger
|
||||
import (
|
||||
)
|
||||
|
||||
|
||||
type Category struct {
|
||||
|
||||
Id int64 `json:"id,omitempty"`
|
||||
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
@ -4,11 +4,18 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
|
||||
type Order struct {
|
||||
|
||||
Id int64 `json:"id,omitempty"`
|
||||
|
||||
PetId int64 `json:"petId,omitempty"`
|
||||
|
||||
Quantity int32 `json:"quantity,omitempty"`
|
||||
|
||||
ShipDate time.Time `json:"shipDate,omitempty"`
|
||||
// Order Status
|
||||
Status string `json:"status,omitempty"`
|
||||
|
||||
Complete bool `json:"complete,omitempty"`
|
||||
}
|
||||
|
@ -3,11 +3,18 @@ package swagger
|
||||
import (
|
||||
)
|
||||
|
||||
|
||||
type Pet struct {
|
||||
|
||||
Id int64 `json:"id,omitempty"`
|
||||
|
||||
Category Category `json:"category,omitempty"`
|
||||
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
PhotoUrls []string `json:"photoUrls,omitempty"`
|
||||
|
||||
Tags []Tag `json:"tags,omitempty"`
|
||||
// pet status in the store
|
||||
Status string `json:"status,omitempty"`
|
||||
}
|
||||
|
@ -3,7 +3,10 @@ package swagger
|
||||
import (
|
||||
)
|
||||
|
||||
|
||||
type Tag struct {
|
||||
|
||||
Id int64 `json:"id,omitempty"`
|
||||
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
@ -3,13 +3,22 @@ package swagger
|
||||
import (
|
||||
)
|
||||
|
||||
|
||||
type User struct {
|
||||
|
||||
Id int64 `json:"id,omitempty"`
|
||||
|
||||
Username string `json:"username,omitempty"`
|
||||
|
||||
FirstName string `json:"firstName,omitempty"`
|
||||
|
||||
LastName string `json:"lastName,omitempty"`
|
||||
|
||||
Email string `json:"email,omitempty"`
|
||||
|
||||
Password string `json:"password,omitempty"`
|
||||
|
||||
Phone string `json:"phone,omitempty"`
|
||||
// User Status
|
||||
UserStatus int32 `json:"userStatus,omitempty"`
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user