From aa35733fd9f24082014faf23a5ef05e6df2a3426 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Tue, 11 Nov 2025 21:26:22 +0200 Subject: [PATCH] chore: fix typos in comments Signed-off-by: Oleksandr Redko --- normalizer.go | 2 +- operation.go | 2 +- ref.go | 2 +- resolver.go | 2 +- resolver_test.go | 4 ++-- spec.go | 2 +- spec_test.go | 2 +- validations.go | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/normalizer.go b/normalizer.go index c3ea810..e1d7c58 100644 --- a/normalizer.go +++ b/normalizer.go @@ -84,7 +84,7 @@ func denormalizeRef(ref *Ref, originalRelativeBase, id string) Ref { if id != "" { idBaseURL, err := parseURL(id) if err == nil { // if the schema id is not usable as a URI, ignore it - if ref, ok := rebase(ref, idBaseURL, true); ok { // rebase, but keep references to root unchaged (do not want $ref: "") + if ref, ok := rebase(ref, idBaseURL, true); ok { // rebase, but keep references to root unchanged (do not want $ref: "") // $ref relative to the ID of the schema in the root document return ref } diff --git a/operation.go b/operation.go index bbf8c75..29d9c4f 100644 --- a/operation.go +++ b/operation.go @@ -176,7 +176,7 @@ func (o *Operation) Deprecate() *Operation { return o } -// Undeprecate marks the operation as not deprected +// Undeprecate marks the operation as not deprecated func (o *Operation) Undeprecate() *Operation { o.Deprecated = false return o diff --git a/ref.go b/ref.go index c927926..1d1c759 100644 --- a/ref.go +++ b/ref.go @@ -24,7 +24,7 @@ func (r Refable) MarshalJSON() ([]byte, error) { return r.Ref.MarshalJSON() } -// UnmarshalJSON unmarshalss the ref from json +// UnmarshalJSON unmarshals the ref from json func (r *Refable) UnmarshalJSON(d []byte) error { return json.Unmarshal(d, &r.Ref) } diff --git a/resolver.go b/resolver.go index b82c182..600574e 100644 --- a/resolver.go +++ b/resolver.go @@ -110,7 +110,7 @@ func ResolvePathItem(root any, ref Ref, options *ExpandOptions) (*PathItem, erro // ResolveItemsWithBase resolves parameter items reference against a context root and base path. // -// NOTE: stricly speaking, this construct is not supported by Swagger 2.0. +// NOTE: strictly speaking, this construct is not supported by Swagger 2.0. // Similarly, $ref are forbidden in response headers. func ResolveItemsWithBase(root any, ref Ref, options *ExpandOptions) (*Items, error) { result := new(Items) diff --git a/resolver_test.go b/resolver_test.go index f9e20bc..e8d6311 100644 --- a/resolver_test.go +++ b/resolver_test.go @@ -412,7 +412,7 @@ func TestResolveExtraItem(t *testing.T) { require.NoError(t, json.Unmarshal(specDoc, spec)) - // Resolve param Items use case: here we explicitly resolve the unsuppord case + // Resolve param Items use case: here we explicitly resolve the unsupported case parm := spec.Paths.Paths["/employees"].Get.Parameters[0] parmItem, err := ResolveItems(spec, parm.Items.Ref, &ExpandOptions{RelativeBase: extraRefFixture}) require.NoError(t, err) @@ -424,7 +424,7 @@ func TestResolveExtraItem(t *testing.T) { "format": "int32" }`, jazon) - // Resolve header Items use case: here we explicitly resolve the unsuppord case + // Resolve header Items use case: here we explicitly resolve the unsupported case hdr := spec.Paths.Paths["/employees"].Get.Responses.StatusCodeResponses[200].Headers["X-header"] hdrItem, err := ResolveItems(spec, hdr.Items.Ref, &ExpandOptions{RelativeBase: extraRefFixture}) require.NoError(t, err) diff --git a/spec.go b/spec.go index 05c3fc7..0d0aaab 100644 --- a/spec.go +++ b/spec.go @@ -28,7 +28,7 @@ func MustLoadJSONSchemaDraft04() *Schema { return d } -// JSONSchemaDraft04 loads the json schema document for json shema draft04 +// JSONSchemaDraft04 loads the json schema document for json schema draft04 func JSONSchemaDraft04() (*Schema, error) { b, err := jsonschemaDraft04JSONBytes() if err != nil { diff --git a/spec_test.go b/spec_test.go index f072f0c..998c7c7 100644 --- a/spec_test.go +++ b/spec_test.go @@ -37,7 +37,7 @@ func TestSpec_Issue2743(t *testing.T) { spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: true, PathLoader: testLoader}), ) - t.Run("all $ref properly reolve when expanding again", func(t *testing.T) { + t.Run("all $ref properly resolve when expanding again", func(t *testing.T) { require.NoError(t, spec.ExpandSpec(sp, &spec.ExpandOptions{RelativeBase: path, SkipSchemas: false, PathLoader: testLoader}), ) diff --git a/validations.go b/validations.go index 4f70e30..2c0dc42 100644 --- a/validations.go +++ b/validations.go @@ -166,7 +166,7 @@ func (v CommonValidations) HasEnum() bool { // SchemaValidations describes the validation properties of a schema // // NOTE: at this moment, this is not embedded in SchemaProps because this would induce a breaking change -// in the exported members: all initializers using litterals would fail. +// in the exported members: all initializers using literals would fail. type SchemaValidations struct { CommonValidations