Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions jsonschema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ type orderedProperties struct {

func (op orderedProperties) MarshalJSON() ([]byte, error) {
var buf bytes.Buffer
buf.WriteByte('{')
if err := buf.WriteByte('{'); err != nil {
return nil, err
}

first := true
processed := make(map[string]bool, len(op.props))
Expand Down Expand Up @@ -373,7 +375,9 @@ func (op orderedProperties) MarshalJSON() ([]byte, error) {
}
}

buf.WriteByte('}')
if err := buf.WriteByte('}'); err != nil {
return nil, err
}
return buf.Bytes(), nil
}

Expand Down