Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openapi3: fix links to JSONPointable iface #803

Merged
merged 1 commit into from
Jun 18, 2023
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 openapi3/callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Callbacks map[string]*CallbackRef

var _ jsonpointer.JSONPointable = (*Callbacks)(nil)

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (c Callbacks) JSONLookup(token string) (interface{}, error) {
ref, ok := c[token]
if ref == nil || !ok {
Expand Down
2 changes: 1 addition & 1 deletion openapi3/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Examples map[string]*ExampleRef

var _ jsonpointer.JSONPointable = (*Examples)(nil)

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (e Examples) JSONLookup(token string) (interface{}, error) {
ref, ok := e[token]
if ref == nil || !ok {
Expand Down
4 changes: 2 additions & 2 deletions openapi3/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Headers map[string]*HeaderRef

var _ jsonpointer.JSONPointable = (*Headers)(nil)

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (h Headers) JSONLookup(token string) (interface{}, error) {
ref, ok := h[token]
if ref == nil || !ok {
Expand All @@ -33,7 +33,7 @@ type Header struct {

var _ jsonpointer.JSONPointable = (*Header)(nil)

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (header Header) JSONLookup(token string) (interface{}, error) {
return header.Parameter.JSONLookup(token)
}
Expand Down
2 changes: 1 addition & 1 deletion openapi3/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

type Links map[string]*LinkRef

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (links Links) JSONLookup(token string) (interface{}, error) {
ref, ok := links[token]
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion openapi3/media_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (mediaType *MediaType) Validate(ctx context.Context, opts ...ValidationOpti
return validateExtensions(ctx, mediaType.Extensions)
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (mediaType MediaType) JSONLookup(token string) (interface{}, error) {
switch token {
case "schema":
Expand Down
2 changes: 1 addition & 1 deletion openapi3/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (operation *Operation) UnmarshalJSON(data []byte) error {
return nil
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (operation Operation) JSONLookup(token string) (interface{}, error) {
switch token {
case "requestBody":
Expand Down
6 changes: 3 additions & 3 deletions openapi3/parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type ParametersMap map[string]*ParameterRef

var _ jsonpointer.JSONPointable = (*ParametersMap)(nil)

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (p ParametersMap) JSONLookup(token string) (interface{}, error) {
ref, ok := p[token]
if ref == nil || !ok {
Expand All @@ -33,7 +33,7 @@ type Parameters []*ParameterRef

var _ jsonpointer.JSONPointable = (*Parameters)(nil)

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (p Parameters) JSONLookup(token string) (interface{}, error) {
index, err := strconv.Atoi(token)
if err != nil {
Expand Down Expand Up @@ -244,7 +244,7 @@ func (parameter *Parameter) UnmarshalJSON(data []byte) error {
return nil
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (parameter Parameter) JSONLookup(token string) (interface{}, error) {
switch token {
case "schema":
Expand Down
18 changes: 9 additions & 9 deletions openapi3/refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (x *CallbackRef) Validate(ctx context.Context, opts ...ValidationOption) er
return foundUnresolvedRef(x.Ref)
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (x *CallbackRef) JSONLookup(token string) (interface{}, error) {
if token == "$ref" {
return x.Ref, nil
Expand Down Expand Up @@ -153,7 +153,7 @@ func (x *ExampleRef) Validate(ctx context.Context, opts ...ValidationOption) err
return foundUnresolvedRef(x.Ref)
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (x *ExampleRef) JSONLookup(token string) (interface{}, error) {
if token == "$ref" {
return x.Ref, nil
Expand Down Expand Up @@ -229,7 +229,7 @@ func (x *HeaderRef) Validate(ctx context.Context, opts ...ValidationOption) erro
return foundUnresolvedRef(x.Ref)
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (x *HeaderRef) JSONLookup(token string) (interface{}, error) {
if token == "$ref" {
return x.Ref, nil
Expand Down Expand Up @@ -305,7 +305,7 @@ func (x *LinkRef) Validate(ctx context.Context, opts ...ValidationOption) error
return foundUnresolvedRef(x.Ref)
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (x *LinkRef) JSONLookup(token string) (interface{}, error) {
if token == "$ref" {
return x.Ref, nil
Expand Down Expand Up @@ -381,7 +381,7 @@ func (x *ParameterRef) Validate(ctx context.Context, opts ...ValidationOption) e
return foundUnresolvedRef(x.Ref)
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (x *ParameterRef) JSONLookup(token string) (interface{}, error) {
if token == "$ref" {
return x.Ref, nil
Expand Down Expand Up @@ -457,7 +457,7 @@ func (x *RequestBodyRef) Validate(ctx context.Context, opts ...ValidationOption)
return foundUnresolvedRef(x.Ref)
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (x *RequestBodyRef) JSONLookup(token string) (interface{}, error) {
if token == "$ref" {
return x.Ref, nil
Expand Down Expand Up @@ -533,7 +533,7 @@ func (x *ResponseRef) Validate(ctx context.Context, opts ...ValidationOption) er
return foundUnresolvedRef(x.Ref)
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (x *ResponseRef) JSONLookup(token string) (interface{}, error) {
if token == "$ref" {
return x.Ref, nil
Expand Down Expand Up @@ -609,7 +609,7 @@ func (x *SchemaRef) Validate(ctx context.Context, opts ...ValidationOption) erro
return foundUnresolvedRef(x.Ref)
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (x *SchemaRef) JSONLookup(token string) (interface{}, error) {
if token == "$ref" {
return x.Ref, nil
Expand Down Expand Up @@ -685,7 +685,7 @@ func (x *SecuritySchemeRef) Validate(ctx context.Context, opts ...ValidationOpti
return foundUnresolvedRef(x.Ref)
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (x *SecuritySchemeRef) JSONLookup(token string) (interface{}, error) {
if token == "$ref" {
return x.Ref, nil
Expand Down
2 changes: 1 addition & 1 deletion openapi3/request_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type RequestBodies map[string]*RequestBodyRef

var _ jsonpointer.JSONPointable = (*RequestBodyRef)(nil)

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (r RequestBodies) JSONLookup(token string) (interface{}, error) {
ref, ok := r[token]
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion openapi3/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (responses Responses) Validate(ctx context.Context, opts ...ValidationOptio
return nil
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (responses Responses) JSONLookup(token string) (interface{}, error) {
ref, ok := responses[token]
if !ok {
Expand Down
6 changes: 3 additions & 3 deletions openapi3/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ type Schemas map[string]*SchemaRef

var _ jsonpointer.JSONPointable = (*Schemas)(nil)

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (s Schemas) JSONLookup(token string) (interface{}, error) {
ref, ok := s[token]
if ref == nil || !ok {
Expand All @@ -98,7 +98,7 @@ type SchemaRefs []*SchemaRef

var _ jsonpointer.JSONPointable = (*SchemaRefs)(nil)

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (s SchemaRefs) JSONLookup(token string) (interface{}, error) {
i, err := strconv.ParseUint(token, 10, 64)
if err != nil {
Expand Down Expand Up @@ -424,7 +424,7 @@ func (schema *Schema) UnmarshalJSON(data []byte) error {
return nil
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (schema Schema) JSONLookup(token string) (interface{}, error) {
switch token {
case "additionalProperties":
Expand Down
2 changes: 1 addition & 1 deletion openapi3/security_scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

type SecuritySchemes map[string]*SecuritySchemeRef

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (s SecuritySchemes) JSONLookup(token string) (interface{}, error) {
ref, ok := s[token]
if ref == nil || !ok {
Expand Down
2 changes: 1 addition & 1 deletion refs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (x *${type}Ref) Validate(ctx context.Context, opts ...ValidationOption) err
return foundUnresolvedRef(x.Ref)
}

// JSONLookup implements github.com/go-openapi/jsonpointer#JSONPointable
// JSONLookup implements https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable
func (x *${type}Ref) JSONLookup(token string) (interface{}, error) {
if token == "\$ref" {
return x.Ref, nil
Expand Down