|
| 1 | +// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT |
| 2 | +// This file was generated by swaggo/swag |
| 3 | + |
| 4 | +package docs |
| 5 | + |
| 6 | +import ( |
| 7 | + "bytes" |
| 8 | + "encoding/json" |
| 9 | + "strings" |
| 10 | + |
| 11 | + "github.com/alecthomas/template" |
| 12 | + "github.com/swaggo/swag" |
| 13 | +) |
| 14 | + |
| 15 | +var doc = `{ |
| 16 | + "schemes": {{ marshal .Schemes }}, |
| 17 | + "swagger": "2.0", |
| 18 | + "info": { |
| 19 | + "description": "{{.Description}}", |
| 20 | + "title": "{{.Title}}", |
| 21 | + "termsOfService": "http://swagger.io/terms/", |
| 22 | + "contact": {}, |
| 23 | + "license": { |
| 24 | + "name": "Apache 2.0", |
| 25 | + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" |
| 26 | + }, |
| 27 | + "version": "{{.Version}}" |
| 28 | + }, |
| 29 | + "host": "{{.Host}}", |
| 30 | + "basePath": "{{.BasePath}}", |
| 31 | + "paths": { |
| 32 | + "/test": { |
| 33 | + "get": { |
| 34 | + "description": "get map", |
| 35 | + "consumes": [ |
| 36 | + "application/json" |
| 37 | + ], |
| 38 | + "produces": [ |
| 39 | + "application/json" |
| 40 | + ], |
| 41 | + "summary": "Get Map Example", |
| 42 | + "operationId": "get-map", |
| 43 | + "responses": { |
| 44 | + "200": { |
| 45 | + "description": "OK", |
| 46 | + "schema": { |
| 47 | + "$ref": "#/definitions/controller.Response" |
| 48 | + } |
| 49 | + } |
| 50 | + } |
| 51 | + } |
| 52 | + } |
| 53 | + }, |
| 54 | + "definitions": { |
| 55 | + "controller.Data": { |
| 56 | + "type": "object", |
| 57 | + "properties": { |
| 58 | + "title": { |
| 59 | + "type": "string", |
| 60 | + "example": "Object data" |
| 61 | + } |
| 62 | + } |
| 63 | + }, |
| 64 | + "controller.Response": { |
| 65 | + "type": "object", |
| 66 | + "properties": { |
| 67 | + "map_data": { |
| 68 | + "type": "object", |
| 69 | + "additionalProperties": { |
| 70 | + "type": "string" |
| 71 | + }, |
| 72 | + "example": { |
| 73 | + "key": "value", |
| 74 | + "key2": "value2" |
| 75 | + } |
| 76 | + }, |
| 77 | + "object": { |
| 78 | + "$ref": "#/definitions/controller.Data" |
| 79 | + }, |
| 80 | + "title": { |
| 81 | + "type": "object", |
| 82 | + "additionalProperties": { |
| 83 | + "type": "string" |
| 84 | + }, |
| 85 | + "example": { |
| 86 | + "en": "Map", |
| 87 | + "kk": "Карталар", |
| 88 | + "ru": "Карта" |
| 89 | + } |
| 90 | + } |
| 91 | + } |
| 92 | + } |
| 93 | + } |
| 94 | +}` |
| 95 | + |
| 96 | +type swaggerInfo struct { |
| 97 | + Version string |
| 98 | + Host string |
| 99 | + BasePath string |
| 100 | + Schemes []string |
| 101 | + Title string |
| 102 | + Description string |
| 103 | +} |
| 104 | + |
| 105 | +// SwaggerInfo holds exported Swagger Info so clients can modify it |
| 106 | +var SwaggerInfo = swaggerInfo{ |
| 107 | + Version: "1.0", |
| 108 | + Host: "localhost:8080", |
| 109 | + BasePath: "/api/v1", |
| 110 | + Schemes: []string{}, |
| 111 | + Title: "Swagger Map Example API", |
| 112 | + Description: "", |
| 113 | +} |
| 114 | + |
| 115 | +type s struct{} |
| 116 | + |
| 117 | +func (s *s) ReadDoc() string { |
| 118 | + sInfo := SwaggerInfo |
| 119 | + sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1) |
| 120 | + |
| 121 | + t, err := template.New("swagger_info").Funcs(template.FuncMap{ |
| 122 | + "marshal": func(v interface{}) string { |
| 123 | + a, _ := json.Marshal(v) |
| 124 | + return string(a) |
| 125 | + }, |
| 126 | + }).Parse(doc) |
| 127 | + if err != nil { |
| 128 | + return doc |
| 129 | + } |
| 130 | + |
| 131 | + var tpl bytes.Buffer |
| 132 | + if err := t.Execute(&tpl, sInfo); err != nil { |
| 133 | + return doc |
| 134 | + } |
| 135 | + |
| 136 | + return tpl.String() |
| 137 | +} |
| 138 | + |
| 139 | +func init() { |
| 140 | + swag.Register(swag.Name, &s{}) |
| 141 | +} |
0 commit comments