|
17 | 17 | Swag converts Go annotations to Swagger Documentation 2.0. We've created a variety of plugins for popular [Go web frameworks](#supported-web-frameworks). This allows you to quickly integrate with an existing Go project (using Swagger UI). |
18 | 18 |
|
19 | 19 | ## Contents |
20 | | - - [Getting started](#getting-started) |
21 | | - - [Supported Web Frameworks](#supported-web-frameworks) |
22 | | - - [How to use it with Gin](#how-to-use-it-with-gin) |
23 | | - - [The swag formatter](#the-swag-formatter) |
24 | | - - [Implementation Status](#implementation-status) |
25 | | - - [Declarative Comments Format](#declarative-comments-format) |
26 | | - - [General API Info](#general-api-info) |
27 | | - - [API Operation](#api-operation) |
28 | | - - [Security](#security) |
29 | | - - [Examples](#examples) |
30 | | - - [Descriptions over multiple lines](#descriptions-over-multiple-lines) |
31 | | - - [User defined structure with an array type](#user-defined-structure-with-an-array-type) |
32 | | - - [Function scoped struct declaration](#function-scoped-struct-declaration) |
33 | | - - [Model composition in response](#model-composition-in-response) |
34 | | - - [Add a headers in response](#add-a-headers-in-response) |
35 | | - - [Use multiple path params](#use-multiple-path-params) |
36 | | - - [Example value of struct](#example-value-of-struct) |
37 | | - - [SchemaExample of body](#schemaexample-of-body) |
38 | | - - [Description of struct](#description-of-struct) |
39 | | - - [Use swaggertype tag to supported custom type](#use-swaggertype-tag-to-supported-custom-type) |
40 | | - - [Use global overrides to support a custom type](#use-global-overrides-to-support-a-custom-type) |
41 | | - - [Use swaggerignore tag to exclude a field](#use-swaggerignore-tag-to-exclude-a-field) |
42 | | - - [Add extension info to struct field](#add-extension-info-to-struct-field) |
43 | | - - [Rename model to display](#rename-model-to-display) |
44 | | - - [How to use security annotations](#how-to-use-security-annotations) |
45 | | - - [Add a description for enum items](#add-a-description-for-enum-items) |
46 | | - - [Generate only specific docs file types](#generate-only-specific-docs-file-types) |
47 | | -- [About the Project](#about-the-project) |
| 20 | +- [swag](#swag) |
| 21 | + - [Contents](#contents) |
| 22 | + - [Getting started](#getting-started) |
| 23 | + - [swag cli](#swag-cli) |
| 24 | + - [Supported Web Frameworks](#supported-web-frameworks) |
| 25 | + - [How to use it with Gin](#how-to-use-it-with-gin) |
| 26 | + - [The swag formatter](#the-swag-formatter) |
| 27 | + - [Implementation Status](#implementation-status) |
| 28 | +- [Declarative Comments Format](#declarative-comments-format) |
| 29 | + - [General API Info](#general-api-info) |
| 30 | + - [Using markdown descriptions](#using-markdown-descriptions) |
| 31 | + - [Open API V3.1.0+](#open-api-v310) |
| 32 | + - [API Operation](#api-operation) |
| 33 | + - [Mime Types](#mime-types) |
| 34 | + - [Param Type](#param-type) |
| 35 | + - [Data Type](#data-type) |
| 36 | + - [Security](#security) |
| 37 | + - [Attribute](#attribute) |
| 38 | + - [Available](#available) |
| 39 | + - [Future](#future) |
| 40 | + - [Examples](#examples) |
| 41 | + - [Descriptions over multiple lines](#descriptions-over-multiple-lines) |
| 42 | + - [User defined structure with an array type](#user-defined-structure-with-an-array-type) |
| 43 | + - [Function scoped struct declaration](#function-scoped-struct-declaration) |
| 44 | + - [Model composition in response](#model-composition-in-response) |
| 45 | + - [Add a headers in response](#add-a-headers-in-response) |
| 46 | + - [Use multiple path params](#use-multiple-path-params) |
| 47 | + - [Add multiple paths](#add-multiple-paths) |
| 48 | + - [Example value of struct](#example-value-of-struct) |
| 49 | + - [SchemaExample of body](#schemaexample-of-body) |
| 50 | + - [Description of struct](#description-of-struct) |
| 51 | + - [Use swaggertype tag to supported custom type](#use-swaggertype-tag-to-supported-custom-type) |
| 52 | + - [Use global overrides to support a custom type](#use-global-overrides-to-support-a-custom-type) |
| 53 | + - [Use swaggerignore tag to exclude a field](#use-swaggerignore-tag-to-exclude-a-field) |
| 54 | + - [Add extension info to struct field](#add-extension-info-to-struct-field) |
| 55 | + - [Rename model to display](#rename-model-to-display) |
| 56 | + - [How to use security annotations](#how-to-use-security-annotations) |
| 57 | + - [Add a description for enum items](#add-a-description-for-enum-items) |
| 58 | + - [Generate only specific docs file types](#generate-only-specific-docs-file-types) |
| 59 | + - [Change the default Go Template action delimiters](#change-the-default-go-template-action-delimiters) |
| 60 | + - [About the Project](#about-the-project) |
| 61 | + - [Contributors](#contributors) |
| 62 | + - [Backers](#backers) |
| 63 | + - [Sponsors](#sponsors) |
| 64 | + - [License](#license) |
48 | 65 |
|
49 | 66 | ## Getting started |
50 | 67 |
|
@@ -486,12 +503,13 @@ Besides that, `swag` also accepts aliases for some MIME Types as follows: |
486 | 503 | ## Security |
487 | 504 | | annotation | description | parameters | example | |
488 | 505 | |------------|-------------|------------|---------| |
489 | | -| securitydefinitions.basic | [Basic](https://swagger.io/docs/specification/2-0/authentication/basic-authentication/) auth. | | // @securityDefinitions.basic BasicAuth | |
490 | | -| securitydefinitions.apikey | [API key](https://swagger.io/docs/specification/2-0/authentication/api-keys/) auth. | in, name, description | // @securityDefinitions.apikey ApiKeyAuth | |
491 | | -| securitydefinitions.oauth2.application | [OAuth2 application](https://swagger.io/docs/specification/authentication/oauth2/) auth. | tokenUrl, scope, description | // @securitydefinitions.oauth2.application OAuth2Application | |
492 | | -| securitydefinitions.oauth2.implicit | [OAuth2 implicit](https://swagger.io/docs/specification/authentication/oauth2/) auth. | authorizationUrl, scope, description | // @securitydefinitions.oauth2.implicit OAuth2Implicit | |
493 | | -| securitydefinitions.oauth2.password | [OAuth2 password](https://swagger.io/docs/specification/authentication/oauth2/) auth. | tokenUrl, scope, description | // @securitydefinitions.oauth2.password OAuth2Password | |
494 | | -| securitydefinitions.oauth2.accessCode | [OAuth2 access code](https://swagger.io/docs/specification/authentication/oauth2/) auth. | tokenUrl, authorizationUrl, scope, description | // @securitydefinitions.oauth2.accessCode OAuth2AccessCode | |
| 506 | +| securitydefinitions.basic | [Basic](https://swagger.io/docs/specification/2-0/authentication/basic-authentication/) auth. | | // @securityDefinitions.basic BasicAuth | |
| 507 | +| securitydefinitions.apikey | [API key](https://swagger.io/docs/specification/2-0/authentication/api-keys/) auth. | in, name, description | // @securityDefinitions.apikey ApiKeyAuth | |
| 508 | +| securitydefinitions.oauth2.application | [OAuth2 application](https://swagger.io/docs/specification/authentication/oauth2/) auth. | tokenUrl, scope, description | // @securitydefinitions.oauth2.application OAuth2Application | |
| 509 | +| securitydefinitions.oauth2.implicit | [OAuth2 implicit](https://swagger.io/docs/specification/authentication/oauth2/) auth. | authorizationUrl, scope, description | // @securitydefinitions.oauth2.implicit OAuth2Implicit | |
| 510 | +| securitydefinitions.oauth2.password | [OAuth2 password](https://swagger.io/docs/specification/authentication/oauth2/) auth. | tokenUrl, scope, description | // @securitydefinitions.oauth2.password OAuth2Password | |
| 511 | +| securitydefinitions.oauth2.accessCode | [OAuth2 access code](https://swagger.io/docs/specification/authentication/oauth2/) auth. | tokenUrl, authorizationUrl, scope, description | // @securitydefinitions.oauth2.accessCode OAuth2AccessCode | |
| 512 | +| securitydefinitions.bearerauth | [Bearer Authentication](https://swagger.io/docs/specification/authentication/bearer-authentication/) auth. supported in Swagger v3.x| | // @securitydefinitions.bearerauth BearerAuth | |
495 | 513 |
|
496 | 514 |
|
497 | 515 | | parameters annotation | example | |
|
0 commit comments