Skip to content

Commit c14c0a6

Browse files
alexandearfredbi
authored andcommitted
chore: fix typos in comments
Signed-off-by: Oleksandr Redko <[email protected]>
1 parent f06cfff commit c14c0a6

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

normalizer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func denormalizeRef(ref *Ref, originalRelativeBase, id string) Ref {
8484
if id != "" {
8585
idBaseURL, err := parseURL(id)
8686
if err == nil { // if the schema id is not usable as a URI, ignore it
87-
if ref, ok := rebase(ref, idBaseURL, true); ok { // rebase, but keep references to root unchaged (do not want $ref: "")
87+
if ref, ok := rebase(ref, idBaseURL, true); ok { // rebase, but keep references to root unchanged (do not want $ref: "")
8888
// $ref relative to the ID of the schema in the root document
8989
return ref
9090
}

operation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (o *Operation) Deprecate() *Operation {
176176
return o
177177
}
178178

179-
// Undeprecate marks the operation as not deprected
179+
// Undeprecate marks the operation as not deprecated
180180
func (o *Operation) Undeprecate() *Operation {
181181
o.Deprecated = false
182182
return o

ref.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func (r Refable) MarshalJSON() ([]byte, error) {
2424
return r.Ref.MarshalJSON()
2525
}
2626

27-
// UnmarshalJSON unmarshalss the ref from json
27+
// UnmarshalJSON unmarshals the ref from json
2828
func (r *Refable) UnmarshalJSON(d []byte) error {
2929
return json.Unmarshal(d, &r.Ref)
3030
}

resolver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func ResolvePathItem(root any, ref Ref, options *ExpandOptions) (*PathItem, erro
110110

111111
// ResolveItemsWithBase resolves parameter items reference against a context root and base path.
112112
//
113-
// NOTE: stricly speaking, this construct is not supported by Swagger 2.0.
113+
// NOTE: strictly speaking, this construct is not supported by Swagger 2.0.
114114
// Similarly, $ref are forbidden in response headers.
115115
func ResolveItemsWithBase(root any, ref Ref, options *ExpandOptions) (*Items, error) {
116116
result := new(Items)

resolver_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ func TestResolveExtraItem(t *testing.T) {
412412

413413
require.NoError(t, json.Unmarshal(specDoc, spec))
414414

415-
// Resolve param Items use case: here we explicitly resolve the unsuppord case
415+
// Resolve param Items use case: here we explicitly resolve the unsupported case
416416
parm := spec.Paths.Paths["/employees"].Get.Parameters[0]
417417
parmItem, err := ResolveItems(spec, parm.Items.Ref, &ExpandOptions{RelativeBase: extraRefFixture})
418418
require.NoError(t, err)
@@ -424,7 +424,7 @@ func TestResolveExtraItem(t *testing.T) {
424424
"format": "int32"
425425
}`, jazon)
426426

427-
// Resolve header Items use case: here we explicitly resolve the unsuppord case
427+
// Resolve header Items use case: here we explicitly resolve the unsupported case
428428
hdr := spec.Paths.Paths["/employees"].Get.Responses.StatusCodeResponses[200].Headers["X-header"]
429429
hdrItem, err := ResolveItems(spec, hdr.Items.Ref, &ExpandOptions{RelativeBase: extraRefFixture})
430430
require.NoError(t, err)

spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func MustLoadJSONSchemaDraft04() *Schema {
2828
return d
2929
}
3030

31-
// JSONSchemaDraft04 loads the json schema document for json shema draft04
31+
// JSONSchemaDraft04 loads the json schema document for json schema draft04
3232
func JSONSchemaDraft04() (*Schema, error) {
3333
b, err := jsonschemaDraft04JSONBytes()
3434
if err != nil {

spec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestSpec_Issue2743(t *testing.T) {
3737
spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader}),
3838
)
3939

40-
t.Run("all $ref properly reolve when expanding again", func(t *testing.T) {
40+
t.Run("all $ref properly resolve when expanding again", func(t *testing.T) {
4141
require.NoError(t,
4242
spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}),
4343
)

validations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (v CommonValidations) HasEnum() bool {
166166
// SchemaValidations describes the validation properties of a schema
167167
//
168168
// NOTE: at this moment, this is not embedded in SchemaProps because this would induce a breaking change
169-
// in the exported members: all initializers using litterals would fail.
169+
// in the exported members: all initializers using literals would fail.
170170
type SchemaValidations struct {
171171
CommonValidations
172172

0 commit comments

Comments
 (0)