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
my post api should accept a model which has some readonly fields(like id...), but swagger seems not to be work well, ok, i found can add 'readonly' tag for work properly, but I think this is not a good way, acctually, the readonly should use for gin or gorm
Problem statement
type MyItem struct {
// id
// Read only: true
ID uint64 json:"id" yaml:"id" binding:"-" gorm:"PRIMARY_KEY;AUTO_INCREMENT" readonly:"true"
}
Swagger specification
Steps to reproduce
Environment
swagger version: x.x.x
go version: x.x.x
OS:
The text was updated successfully, but these errors were encountered:
fredbi
changed the title
my post api should accept a model which has some readonly fields(like id...), but swagger seems not to be work well, ok, i found can add 'readonly' tag for work properly, but I think this is not a good way, acctually, the readonly should use for gin or gorm
my post api should accept a model which has some readonly fields
Aug 11, 2020
The swagger readOnly specification currently doesn't do anything on generated validations. See #936
There is no interaction between the swagger spec and the db-specific tags, unless you force tags manually.
my post api should accept a model which has some readonly fields(like id...), but swagger seems not to be work well, ok, i found can add 'readonly' tag for work properly, but I think this is not a good way, acctually, the readonly should use for gin or gorm
Problem statement
type MyItem struct {
// id
// Read only: true
ID uint64
json:"id" yaml:"id" binding:"-" gorm:"PRIMARY_KEY;AUTO_INCREMENT" readonly:"true"
}
Swagger specification
Steps to reproduce
Environment
swagger version: x.x.x
go version: x.x.x
OS:
The text was updated successfully, but these errors were encountered: