Skip to content

Commit

Permalink
openapi3: spell "marshal" with one "l" for consistency (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear authored Jun 20, 2023
1 parent 0d0b0ae commit 48ce1ee
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion openapi3/internalize_refs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestInternalizeRefs(t *testing.T) {
require.NoError(t, err, "validating internalized spec")

actual, err := doc.MarshalJSON()
require.NoError(t, err, "marshalling internalized spec")
require.NoError(t, err, "marshaling internalized spec")

// run a static check over the file, making sure each occurrence of a
// reference is followed by a #
Expand Down
2 changes: 1 addition & 1 deletion openapi3/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func unmarshal(data []byte, v interface{}) error {
return nil
}

// ResolveRefsIn expands references if for instance spec was just unmarshalled
// ResolveRefsIn expands references if for instance spec was just unmarshaled
func (loader *Loader) ResolveRefsIn(doc *T, location *url.URL) (err error) {
if loader.Context == nil {
loader.Context = context.Background()
Expand Down
8 changes: 4 additions & 4 deletions openapi3/openapi3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ func TestRefsJSON(t *testing.T) {
require.NoError(t, err)
require.NotEmpty(t, data)

t.Log("Resolve refs in unmarshalled *T")
t.Log("Resolve refs in unmarshaled *T")
err = loader.ResolveRefsIn(docA, nil)
require.NoError(t, err)
t.Log("Resolve refs in marshalled *T")
t.Log("Resolve refs in marshaled *T")
docB, err := loader.LoadFromData(data)
require.NoError(t, err)
require.NotEmpty(t, docB)
Expand Down Expand Up @@ -62,10 +62,10 @@ func TestRefsYAML(t *testing.T) {
require.NoError(t, err)
require.NotEmpty(t, data)

t.Log("Resolve refs in unmarshalled *T")
t.Log("Resolve refs in unmarshaled *T")
err = loader.ResolveRefsIn(docA, nil)
require.NoError(t, err)
t.Log("Resolve refs in marshalled *T")
t.Log("Resolve refs in marshaled *T")
docB, err := loader.LoadFromData(data)
require.NoError(t, err)
require.NotEmpty(t, docB)
Expand Down
20 changes: 10 additions & 10 deletions openapi3gen/field_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import (

// theFieldInfo contains information about JSON serialization of a field.
type theFieldInfo struct {
HasJSONTag bool
TypeIsMarshaller bool
TypeIsUnmarshaller bool
JSONOmitEmpty bool
JSONString bool
Index []int
Type reflect.Type
JSONName string
HasJSONTag bool
TypeIsMarshaler bool
TypeIsUnmarshaler bool
JSONOmitEmpty bool
JSONString bool
Index []int
Type reflect.Type
JSONName string
}

func appendFields(fields []theFieldInfo, parentIndex []int, t reflect.Type) []theFieldInfo {
Expand Down Expand Up @@ -94,8 +94,8 @@ iteration:
}
}

_, field.TypeIsMarshaller = field.Type.MethodByName("MarshalJSON")
_, field.TypeIsUnmarshaller = field.Type.MethodByName("UnmarshalJSON")
_, field.TypeIsMarshaler = field.Type.MethodByName("MarshalJSON")
_, field.TypeIsUnmarshaler = field.Type.MethodByName("UnmarshalJSON")

// Field is done
fields = append(fields, field)
Expand Down

0 comments on commit 48ce1ee

Please sign in to comment.