Skip to content

Commit bf482ec

Browse files
authored
Merge pull request #13 from lsst-dm/IT-5635/export-versioninfo
export VersionInfo type
2 parents 08c2cbf + c85a863 commit bf482ec

File tree

5 files changed

+63
-63
lines changed

5 files changed

+63
-63
lines changed

docs/docs.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,29 @@ const docTemplate = `{
109109
"200": {
110110
"description": "OK",
111111
"schema": {
112-
"$ref": "#/definitions/versionInfo"
112+
"$ref": "#/definitions/VersionInfo"
113113
}
114114
}
115115
}
116116
}
117117
}
118118
},
119119
"definitions": {
120+
"VersionInfo": {
121+
"type": "object",
122+
"properties": {
123+
"config": {
124+
"type": "object",
125+
"additionalProperties": {
126+
"type": "string"
127+
}
128+
},
129+
"version": {
130+
"type": "string",
131+
"example": "0.0.0"
132+
}
133+
}
134+
},
120135
"requestStatus200": {
121136
"type": "object",
122137
"properties": {
@@ -283,21 +298,6 @@ const docTemplate = `{
283298
"example": "s3://my-bucket/my-key"
284299
}
285300
}
286-
},
287-
"versionInfo": {
288-
"type": "object",
289-
"properties": {
290-
"config": {
291-
"type": "object",
292-
"additionalProperties": {
293-
"type": "string"
294-
}
295-
},
296-
"version": {
297-
"type": "string",
298-
"example": "0.0.0"
299-
}
300-
}
301301
}
302302
}
303303
}`

docs/swagger.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,29 @@
100100
"200": {
101101
"description": "OK",
102102
"schema": {
103-
"$ref": "#/definitions/versionInfo"
103+
"$ref": "#/definitions/VersionInfo"
104104
}
105105
}
106106
}
107107
}
108108
}
109109
},
110110
"definitions": {
111+
"VersionInfo": {
112+
"type": "object",
113+
"properties": {
114+
"config": {
115+
"type": "object",
116+
"additionalProperties": {
117+
"type": "string"
118+
}
119+
},
120+
"version": {
121+
"type": "string",
122+
"example": "0.0.0"
123+
}
124+
}
125+
},
111126
"requestStatus200": {
112127
"type": "object",
113128
"properties": {
@@ -274,21 +289,6 @@
274289
"example": "s3://my-bucket/my-key"
275290
}
276291
}
277-
},
278-
"versionInfo": {
279-
"type": "object",
280-
"properties": {
281-
"config": {
282-
"type": "object",
283-
"additionalProperties": {
284-
"type": "string"
285-
}
286-
},
287-
"version": {
288-
"type": "string",
289-
"example": "0.0.0"
290-
}
291-
}
292292
}
293293
}
294294
}

docs/swagger.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,22 @@ Status: Gateway Timeout
161161

162162
## Models
163163

164+
### <span id="version-info"></span> VersionInfo
165+
166+
167+
168+
169+
170+
171+
**Properties**
172+
173+
| Name | Type | Go type | Required | Default | Description | Example |
174+
|------|------|---------|:--------:| ------- |-------------|---------|
175+
| config | map of string| `map[string]string` | | | | |
176+
| version | string| `string` | | | | `0.0.0` |
177+
178+
179+
164180
### <span id="request-status200"></span> requestStatus200
165181

166182

@@ -313,19 +329,3 @@ Status: Gateway Timeout
313329
| uri | string| `string` | | | | `s3://my-bucket/my-key` |
314330

315331

316-
317-
### <span id="version-info"></span> versionInfo
318-
319-
320-
321-
322-
323-
324-
**Properties**
325-
326-
| Name | Type | Go type | Required | Default | Description | Example |
327-
|------|------|---------|:--------:| ------- |-------------|---------|
328-
| config | map of string| `map[string]string` | | | | |
329-
| version | string| `string` | | | | `0.0.0` |
330-
331-

docs/swagger.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
definitions:
2+
VersionInfo:
3+
properties:
4+
config:
5+
additionalProperties:
6+
type: string
7+
type: object
8+
version:
9+
example: 0.0.0
10+
type: string
11+
type: object
212
requestStatus200:
313
properties:
414
code:
@@ -119,16 +129,6 @@ definitions:
119129
example: s3://my-bucket/my-key
120130
type: string
121131
type: object
122-
versionInfo:
123-
properties:
124-
config:
125-
additionalProperties:
126-
type: string
127-
type: object
128-
version:
129-
example: 0.0.0
130-
type: string
131-
type: object
132132
info:
133133
contact:
134134
name: Support
@@ -196,7 +196,7 @@ paths:
196196
"200":
197197
description: OK
198198
schema:
199-
$ref: '#/definitions/versionInfo'
199+
$ref: '#/definitions/VersionInfo'
200200
summary: report service version and configuration
201201
tags:
202202
- version

version/handler.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ type VersionHandler struct {
1111
conf *conf.S3ndConf
1212
}
1313

14-
type versionInfo struct {
14+
type VersionInfo struct {
1515
Version string `json:"version" example:"0.0.0"`
1616
Config map[string]string `json:"config,omitempty"`
17-
} // @name versionInfo
17+
} // @name VersionInfo
1818

1919
func NewHandler(conf *conf.S3ndConf) *VersionHandler {
2020
return &VersionHandler{conf: conf}
@@ -23,10 +23,10 @@ func NewHandler(conf *conf.S3ndConf) *VersionHandler {
2323
// @summary report service version and configuration
2424
// @tags version
2525
// @produce json
26-
// @success 200 {object} versionInfo
26+
// @success 200 {object} VersionInfo
2727
// @router /version [get]
2828
func (h *VersionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
29-
info := &versionInfo{
29+
info := &VersionInfo{
3030
Version: Version,
3131
Config: h.conf.ToMap(),
3232
}

0 commit comments

Comments
 (0)