Skip to content

Commit

Permalink
chore: fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Jun 27, 2024
1 parent 44513cf commit c830164
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ type PathItem struct {
Common OpenAPICommon `json:"-" yaml:",inline"`
}

// MarshalJSON implements [json.Marshaler].
func (s *PathItem) MarshalJSON() ([]byte, error) {
type Alias PathItem
originalJSON, err := json.Marshal(Alias(*s))
Expand Down Expand Up @@ -416,6 +417,7 @@ type Operation struct {
Common OpenAPICommon `json:"-" yaml:",inline"`
}

// MarshalJSON implements [json.Marshaler].
func (s *Operation) MarshalJSON() ([]byte, error) {
type Alias Operation
originalJSON, err := json.Marshal(Alias(*s))
Expand Down
4 changes: 2 additions & 2 deletions spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ func TestExtensionsMarshal(t *testing.T) {
pathItem := ogen.NewPathItem()
pathItem.Common = extensionValueFunc(extentionKey, extenstionValue)

pathItemJson, err := json.Marshal(pathItem)
pathItemJSON, err := json.Marshal(pathItem)
a.NoError(err)

var output map[string]interface{}
err = json.Unmarshal(pathItemJson, &output)
err = json.Unmarshal(pathItemJSON, &output)
a.NoError(err)

v, ok := output[extentionKey]
Expand Down

0 comments on commit c830164

Please sign in to comment.