Skip to content

Commit

Permalink
Add an example of add a description for enum items (#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
shouhei authored Mar 26, 2021
1 parent 19e5237 commit 17c1766
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Swag converts Go annotations to Swagger Documentation 2.0. We've created a varie
- [Add extension info to struct field](#add-extension-info-to-struct-field)
- [Rename model to display](#rename-model-to-display)
- [How to using security annotations](#how-to-using-security-annotations)
- [Add a description for enum items](#add-a-description-for-enum-items)
- [About the Project](#about-the-project)

## Getting started
Expand Down Expand Up @@ -726,6 +727,17 @@ Make it AND condition
// @Security OAuth2Application[write, admin]
```
### Add a description for enum items
```go
type Example struct {
// Sort order:
// * asc - Ascending, from A to Z.
// * desc - Descending, from Z to A.
Order string `enums:"asc,desc"`
}
```
## About the Project
This project was inspired by [yvasiyarov/swagger](https://github.com/yvasiyarov/swagger) but we simplified the usage and added support a variety of [web frameworks](#supported-web-frameworks). Gopher image source is [tenntenn/gopher-stickers](https://github.com/tenntenn/gopher-stickers). It has licenses [creative commons licensing](http://creativecommons.org/licenses/by/3.0/deed.en).
## Contributors
Expand Down

0 comments on commit 17c1766

Please sign in to comment.