Skip to content

Commit 48ce1ee

Browse files
authored
openapi3: spell "marshal" with one "l" for consistency (#808)
1 parent 0d0b0ae commit 48ce1ee

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

openapi3/internalize_refs_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func TestInternalizeRefs(t *testing.T) {
4242
require.NoError(t, err, "validating internalized spec")
4343

4444
actual, err := doc.MarshalJSON()
45-
require.NoError(t, err, "marshalling internalized spec")
45+
require.NoError(t, err, "marshaling internalized spec")
4646

4747
// run a static check over the file, making sure each occurrence of a
4848
// reference is followed by a #

openapi3/loader.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func unmarshal(data []byte, v interface{}) error {
182182
return nil
183183
}
184184

185-
// ResolveRefsIn expands references if for instance spec was just unmarshalled
185+
// ResolveRefsIn expands references if for instance spec was just unmarshaled
186186
func (loader *Loader) ResolveRefsIn(doc *T, location *url.URL) (err error) {
187187
if loader.Context == nil {
188188
loader.Context = context.Background()

openapi3/openapi3_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ func TestRefsJSON(t *testing.T) {
2424
require.NoError(t, err)
2525
require.NotEmpty(t, data)
2626

27-
t.Log("Resolve refs in unmarshalled *T")
27+
t.Log("Resolve refs in unmarshaled *T")
2828
err = loader.ResolveRefsIn(docA, nil)
2929
require.NoError(t, err)
30-
t.Log("Resolve refs in marshalled *T")
30+
t.Log("Resolve refs in marshaled *T")
3131
docB, err := loader.LoadFromData(data)
3232
require.NoError(t, err)
3333
require.NotEmpty(t, docB)
@@ -62,10 +62,10 @@ func TestRefsYAML(t *testing.T) {
6262
require.NoError(t, err)
6363
require.NotEmpty(t, data)
6464

65-
t.Log("Resolve refs in unmarshalled *T")
65+
t.Log("Resolve refs in unmarshaled *T")
6666
err = loader.ResolveRefsIn(docA, nil)
6767
require.NoError(t, err)
68-
t.Log("Resolve refs in marshalled *T")
68+
t.Log("Resolve refs in marshaled *T")
6969
docB, err := loader.LoadFromData(data)
7070
require.NoError(t, err)
7171
require.NotEmpty(t, docB)

openapi3gen/field_info.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import (
99

1010
// theFieldInfo contains information about JSON serialization of a field.
1111
type theFieldInfo struct {
12-
HasJSONTag bool
13-
TypeIsMarshaller bool
14-
TypeIsUnmarshaller bool
15-
JSONOmitEmpty bool
16-
JSONString bool
17-
Index []int
18-
Type reflect.Type
19-
JSONName string
12+
HasJSONTag bool
13+
TypeIsMarshaler bool
14+
TypeIsUnmarshaler bool
15+
JSONOmitEmpty bool
16+
JSONString bool
17+
Index []int
18+
Type reflect.Type
19+
JSONName string
2020
}
2121

2222
func appendFields(fields []theFieldInfo, parentIndex []int, t reflect.Type) []theFieldInfo {
@@ -94,8 +94,8 @@ iteration:
9494
}
9595
}
9696

97-
_, field.TypeIsMarshaller = field.Type.MethodByName("MarshalJSON")
98-
_, field.TypeIsUnmarshaller = field.Type.MethodByName("UnmarshalJSON")
97+
_, field.TypeIsMarshaler = field.Type.MethodByName("MarshalJSON")
98+
_, field.TypeIsUnmarshaler = field.Type.MethodByName("UnmarshalJSON")
9999

100100
// Field is done
101101
fields = append(fields, field)

0 commit comments

Comments
 (0)