swagger
swagger copied to clipboard
Support for parser pointer array
Hi! Now it's not parsing
type ServiceTypes []*ServiceType
func (st *ServiceTypes ) Add () {
// any code and any function for work with st
}
type ServiceType struct {
Type string
}
type Service struct {
Id bson.ObjectId `json:"id,omitempty" bson:"id"`
TargetLang string `json:"targetLang,required" description:"Language.Tag" bson:"targetLang"`
SourceLang string `json:"sourceLang,required" description:"Language.Tag" bson:"sourceLang"`
Types *ServiceTypes `json:"types,required"" bson:"types"`
Genres Genres `json:"genres" bson:"genres"`
Taxonomies Taxonomies `json:"taxonomies" bson:"taxonomies"`
}
If I change to
type Service struct {
Id bson.ObjectId `json:"id,omitempty" bson:"id"`
TargetLang string `json:"targetLang,required" description:"Language.Tag" bson:"targetLang"`
SourceLang string `json:"sourceLang,required" description:"Language.Tag" bson:"sourceLang"`
Types []*ServiceType `json:"types,required"" bson:"types"`
Genres Genres `json:"genres" bson:"genres"`
Taxonomies Taxonomies `json:"taxonomies" bson:"taxonomies"`
}
It's worked.
You can support this pattern in parser?
@antonikonovalov can you submit pull request, please ?
You have idea how it's make in parser
?
In my case, bson.ObjectId could be not parsing. @antonikonovalov How did you pass?
Can not find definition of ObjectId model. Name looks like absolute, but model not found in gopkg/in/mgo/v2/bson package