Skip to content

Commit 0e667d0

Browse files
authored
Add missing fields of response header object (#89)
According to the documentation https://swagger.io/specification/v2/#headerObject, every header obejct has same fields like its items. Added the `format`, `default` and `collectionFormat` fields.
1 parent ea94030 commit 0e667d0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

build_path.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,12 @@ func buildHeader(header restful.Header) spec.Header {
305305
responseHeader := spec.Header{}
306306
responseHeader.Type = header.Type
307307
responseHeader.Description = header.Description
308+
responseHeader.Format = header.Format
309+
responseHeader.Default = header.Default
308310

309311
// If type is "array" items field is required
310312
if header.Type == arrayType {
313+
responseHeader.CollectionFormat = header.CollectionFormat
311314
responseHeader.Items = buildHeadersItems(header.Items)
312315
}
313316

0 commit comments

Comments
 (0)