Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion normalizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion spec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}),
)
Expand Down
2 changes: 1 addition & 1 deletion validations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading