fix: include tags in rendered OpenAPI

This commit is contained in:
Daniel G. Taylor 2020-10-02 11:36:29 -07:00
parent 8ae23b5a44
commit 127d4d748c
No known key found for this signature in database
GPG key ID: 8D100732CA686E06

View file

@ -30,7 +30,13 @@ func (r *Resource) toOpenAPI() *gabs.Container {
}
for _, op := range r.operations {
doc.Set(op.toOpenAPI(), r.path, strings.ToLower(op.method))
opValue := op.toOpenAPI()
if len(r.tags) > 0 {
opValue.Set(r.tags, "tags")
}
doc.Set(opValue, r.path, strings.ToLower(op.method))
}
return doc