Skip to content

Commit 91659ae

Browse files
authored
openapi3: fix format error when Header marshal to YAML (#823)
1 parent e27de61 commit 91659ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

openapi3/header.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ func (header *Header) UnmarshalJSON(data []byte) error {
4848
return header.Parameter.UnmarshalJSON(data)
4949
}
5050

51+
// MarshalJSON returns the JSON encoding of Header.
52+
func (header Header) MarshalYAML() (interface{}, error) {
53+
return header.Parameter, nil
54+
}
55+
5156
// SerializationMethod returns a header's serialization method.
5257
func (header *Header) SerializationMethod() (*SerializationMethod, error) {
5358
style := header.Style

0 commit comments

Comments
 (0)