go.mod: Update oapi-codegen and kin-openapi
This commit is contained in:
parent
add17bba45
commit
a83cf95d5b
156 changed files with 29663 additions and 2248 deletions
173
vendor/github.com/getkin/kin-openapi/openapi3/refs.go
generated
vendored
173
vendor/github.com/getkin/kin-openapi/openapi3/refs.go
generated
vendored
|
|
@ -4,13 +4,21 @@ import (
|
|||
"context"
|
||||
|
||||
"github.com/getkin/kin-openapi/jsoninfo"
|
||||
"github.com/go-openapi/jsonpointer"
|
||||
)
|
||||
|
||||
// Ref is specified by OpenAPI/Swagger 3.0 standard.
|
||||
type Ref struct {
|
||||
Ref string `json:"$ref" yaml:"$ref"`
|
||||
}
|
||||
|
||||
type CallbackRef struct {
|
||||
Ref string
|
||||
Value *Callback
|
||||
}
|
||||
|
||||
var _ jsonpointer.JSONPointable = (*CallbackRef)(nil)
|
||||
|
||||
func (value *CallbackRef) MarshalJSON() ([]byte, error) {
|
||||
return jsoninfo.MarshalRef(value.Ref, value.Value)
|
||||
}
|
||||
|
|
@ -19,12 +27,20 @@ func (value *CallbackRef) UnmarshalJSON(data []byte) error {
|
|||
return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
|
||||
}
|
||||
|
||||
func (value *CallbackRef) Validate(c context.Context) error {
|
||||
v := value.Value
|
||||
if v == nil {
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
func (value *CallbackRef) Validate(ctx context.Context) error {
|
||||
if v := value.Value; v != nil {
|
||||
return v.Validate(ctx)
|
||||
}
|
||||
return v.Validate(c)
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
}
|
||||
|
||||
func (value CallbackRef) JSONLookup(token string) (interface{}, error) {
|
||||
if token == "$ref" {
|
||||
return value.Ref, nil
|
||||
}
|
||||
|
||||
ptr, _, err := jsonpointer.GetForToken(value.Value, token)
|
||||
return ptr, err
|
||||
}
|
||||
|
||||
type ExampleRef struct {
|
||||
|
|
@ -32,6 +48,8 @@ type ExampleRef struct {
|
|||
Value *Example
|
||||
}
|
||||
|
||||
var _ jsonpointer.JSONPointable = (*ExampleRef)(nil)
|
||||
|
||||
func (value *ExampleRef) MarshalJSON() ([]byte, error) {
|
||||
return jsoninfo.MarshalRef(value.Ref, value.Value)
|
||||
}
|
||||
|
|
@ -40,8 +58,20 @@ func (value *ExampleRef) UnmarshalJSON(data []byte) error {
|
|||
return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
|
||||
}
|
||||
|
||||
func (value *ExampleRef) Validate(c context.Context) error {
|
||||
return nil
|
||||
func (value *ExampleRef) Validate(ctx context.Context) error {
|
||||
if v := value.Value; v != nil {
|
||||
return v.Validate(ctx)
|
||||
}
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
}
|
||||
|
||||
func (value ExampleRef) JSONLookup(token string) (interface{}, error) {
|
||||
if token == "$ref" {
|
||||
return value.Ref, nil
|
||||
}
|
||||
|
||||
ptr, _, err := jsonpointer.GetForToken(value.Value, token)
|
||||
return ptr, err
|
||||
}
|
||||
|
||||
type HeaderRef struct {
|
||||
|
|
@ -49,6 +79,8 @@ type HeaderRef struct {
|
|||
Value *Header
|
||||
}
|
||||
|
||||
var _ jsonpointer.JSONPointable = (*HeaderRef)(nil)
|
||||
|
||||
func (value *HeaderRef) MarshalJSON() ([]byte, error) {
|
||||
return jsoninfo.MarshalRef(value.Ref, value.Value)
|
||||
}
|
||||
|
|
@ -57,12 +89,20 @@ func (value *HeaderRef) UnmarshalJSON(data []byte) error {
|
|||
return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
|
||||
}
|
||||
|
||||
func (value *HeaderRef) Validate(c context.Context) error {
|
||||
v := value.Value
|
||||
if v == nil {
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
func (value *HeaderRef) Validate(ctx context.Context) error {
|
||||
if v := value.Value; v != nil {
|
||||
return v.Validate(ctx)
|
||||
}
|
||||
return v.Validate(c)
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
}
|
||||
|
||||
func (value HeaderRef) JSONLookup(token string) (interface{}, error) {
|
||||
if token == "$ref" {
|
||||
return value.Ref, nil
|
||||
}
|
||||
|
||||
ptr, _, err := jsonpointer.GetForToken(value.Value, token)
|
||||
return ptr, err
|
||||
}
|
||||
|
||||
type LinkRef struct {
|
||||
|
|
@ -78,12 +118,11 @@ func (value *LinkRef) UnmarshalJSON(data []byte) error {
|
|||
return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
|
||||
}
|
||||
|
||||
func (value *LinkRef) Validate(c context.Context) error {
|
||||
v := value.Value
|
||||
if v == nil {
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
func (value *LinkRef) Validate(ctx context.Context) error {
|
||||
if v := value.Value; v != nil {
|
||||
return v.Validate(ctx)
|
||||
}
|
||||
return v.Validate(c)
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
}
|
||||
|
||||
type ParameterRef struct {
|
||||
|
|
@ -91,6 +130,8 @@ type ParameterRef struct {
|
|||
Value *Parameter
|
||||
}
|
||||
|
||||
var _ jsonpointer.JSONPointable = (*ParameterRef)(nil)
|
||||
|
||||
func (value *ParameterRef) MarshalJSON() ([]byte, error) {
|
||||
return jsoninfo.MarshalRef(value.Ref, value.Value)
|
||||
}
|
||||
|
|
@ -99,12 +140,20 @@ func (value *ParameterRef) UnmarshalJSON(data []byte) error {
|
|||
return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
|
||||
}
|
||||
|
||||
func (value *ParameterRef) Validate(c context.Context) error {
|
||||
v := value.Value
|
||||
if v == nil {
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
func (value *ParameterRef) Validate(ctx context.Context) error {
|
||||
if v := value.Value; v != nil {
|
||||
return v.Validate(ctx)
|
||||
}
|
||||
return v.Validate(c)
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
}
|
||||
|
||||
func (value ParameterRef) JSONLookup(token string) (interface{}, error) {
|
||||
if token == "$ref" {
|
||||
return value.Ref, nil
|
||||
}
|
||||
|
||||
ptr, _, err := jsonpointer.GetForToken(value.Value, token)
|
||||
return ptr, err
|
||||
}
|
||||
|
||||
type ResponseRef struct {
|
||||
|
|
@ -112,6 +161,8 @@ type ResponseRef struct {
|
|||
Value *Response
|
||||
}
|
||||
|
||||
var _ jsonpointer.JSONPointable = (*ResponseRef)(nil)
|
||||
|
||||
func (value *ResponseRef) MarshalJSON() ([]byte, error) {
|
||||
return jsoninfo.MarshalRef(value.Ref, value.Value)
|
||||
}
|
||||
|
|
@ -120,12 +171,20 @@ func (value *ResponseRef) UnmarshalJSON(data []byte) error {
|
|||
return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
|
||||
}
|
||||
|
||||
func (value *ResponseRef) Validate(c context.Context) error {
|
||||
v := value.Value
|
||||
if v == nil {
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
func (value *ResponseRef) Validate(ctx context.Context) error {
|
||||
if v := value.Value; v != nil {
|
||||
return v.Validate(ctx)
|
||||
}
|
||||
return v.Validate(c)
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
}
|
||||
|
||||
func (value ResponseRef) JSONLookup(token string) (interface{}, error) {
|
||||
if token == "$ref" {
|
||||
return value.Ref, nil
|
||||
}
|
||||
|
||||
ptr, _, err := jsonpointer.GetForToken(value.Value, token)
|
||||
return ptr, err
|
||||
}
|
||||
|
||||
type RequestBodyRef struct {
|
||||
|
|
@ -133,6 +192,8 @@ type RequestBodyRef struct {
|
|||
Value *RequestBody
|
||||
}
|
||||
|
||||
var _ jsonpointer.JSONPointable = (*RequestBodyRef)(nil)
|
||||
|
||||
func (value *RequestBodyRef) MarshalJSON() ([]byte, error) {
|
||||
return jsoninfo.MarshalRef(value.Ref, value.Value)
|
||||
}
|
||||
|
|
@ -141,12 +202,20 @@ func (value *RequestBodyRef) UnmarshalJSON(data []byte) error {
|
|||
return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
|
||||
}
|
||||
|
||||
func (value *RequestBodyRef) Validate(c context.Context) error {
|
||||
v := value.Value
|
||||
if v == nil {
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
func (value *RequestBodyRef) Validate(ctx context.Context) error {
|
||||
if v := value.Value; v != nil {
|
||||
return v.Validate(ctx)
|
||||
}
|
||||
return v.Validate(c)
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
}
|
||||
|
||||
func (value RequestBodyRef) JSONLookup(token string) (interface{}, error) {
|
||||
if token == "$ref" {
|
||||
return value.Ref, nil
|
||||
}
|
||||
|
||||
ptr, _, err := jsonpointer.GetForToken(value.Value, token)
|
||||
return ptr, err
|
||||
}
|
||||
|
||||
type SchemaRef struct {
|
||||
|
|
@ -154,6 +223,8 @@ type SchemaRef struct {
|
|||
Value *Schema
|
||||
}
|
||||
|
||||
var _ jsonpointer.JSONPointable = (*SchemaRef)(nil)
|
||||
|
||||
func NewSchemaRef(ref string, value *Schema) *SchemaRef {
|
||||
return &SchemaRef{
|
||||
Ref: ref,
|
||||
|
|
@ -169,12 +240,20 @@ func (value *SchemaRef) UnmarshalJSON(data []byte) error {
|
|||
return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
|
||||
}
|
||||
|
||||
func (value *SchemaRef) Validate(c context.Context) error {
|
||||
v := value.Value
|
||||
if v == nil {
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
func (value *SchemaRef) Validate(ctx context.Context) error {
|
||||
if v := value.Value; v != nil {
|
||||
return v.Validate(ctx)
|
||||
}
|
||||
return v.Validate(c)
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
}
|
||||
|
||||
func (value SchemaRef) JSONLookup(token string) (interface{}, error) {
|
||||
if token == "$ref" {
|
||||
return value.Ref, nil
|
||||
}
|
||||
|
||||
ptr, _, err := jsonpointer.GetForToken(value.Value, token)
|
||||
return ptr, err
|
||||
}
|
||||
|
||||
type SecuritySchemeRef struct {
|
||||
|
|
@ -182,6 +261,8 @@ type SecuritySchemeRef struct {
|
|||
Value *SecurityScheme
|
||||
}
|
||||
|
||||
var _ jsonpointer.JSONPointable = (*SecuritySchemeRef)(nil)
|
||||
|
||||
func (value *SecuritySchemeRef) MarshalJSON() ([]byte, error) {
|
||||
return jsoninfo.MarshalRef(value.Ref, value.Value)
|
||||
}
|
||||
|
|
@ -190,10 +271,18 @@ func (value *SecuritySchemeRef) UnmarshalJSON(data []byte) error {
|
|||
return jsoninfo.UnmarshalRef(data, &value.Ref, &value.Value)
|
||||
}
|
||||
|
||||
func (value *SecuritySchemeRef) Validate(c context.Context) error {
|
||||
v := value.Value
|
||||
if v == nil {
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
func (value *SecuritySchemeRef) Validate(ctx context.Context) error {
|
||||
if v := value.Value; v != nil {
|
||||
return v.Validate(ctx)
|
||||
}
|
||||
return v.Validate(c)
|
||||
return foundUnresolvedRef(value.Ref)
|
||||
}
|
||||
|
||||
func (value SecuritySchemeRef) JSONLookup(token string) (interface{}, error) {
|
||||
if token == "$ref" {
|
||||
return value.Ref, nil
|
||||
}
|
||||
|
||||
ptr, _, err := jsonpointer.GetForToken(value.Value, token)
|
||||
return ptr, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue