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

Replace interface{} with any #966

Merged
merged 6 commits into from
Jun 18, 2024
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
24 changes: 12 additions & 12 deletions .github/docs/openapi2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (header *Header) UnmarshalJSON(data []byte) error
UnmarshalJSON sets Header to a copy of data.

type Operation struct {
Extensions map[string]interface{} `json:"-" yaml:"-"`
Extensions map[string]any `json:"-" yaml:"-"`

Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Expand All @@ -43,7 +43,7 @@ func (operation *Operation) UnmarshalJSON(data []byte) error
UnmarshalJSON sets Operation to a copy of data.

type Parameter struct {
Extensions map[string]interface{} `json:"-" yaml:"-"`
Extensions map[string]any `json:"-" yaml:"-"`

Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`

Expand All @@ -61,15 +61,15 @@ type Parameter struct {
ExclusiveMax bool `json:"exclusiveMaximum,omitempty" yaml:"exclusiveMaximum,omitempty"`
Schema *openapi3.SchemaRef `json:"schema,omitempty" yaml:"schema,omitempty"`
Items *openapi3.SchemaRef `json:"items,omitempty" yaml:"items,omitempty"`
Enum []interface{} `json:"enum,omitempty" yaml:"enum,omitempty"`
Enum []any `json:"enum,omitempty" yaml:"enum,omitempty"`
MultipleOf *float64 `json:"multipleOf,omitempty" yaml:"multipleOf,omitempty"`
Minimum *float64 `json:"minimum,omitempty" yaml:"minimum,omitempty"`
Maximum *float64 `json:"maximum,omitempty" yaml:"maximum,omitempty"`
MaxLength *uint64 `json:"maxLength,omitempty" yaml:"maxLength,omitempty"`
MaxItems *uint64 `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`
MinLength uint64 `json:"minLength,omitempty" yaml:"minLength,omitempty"`
MinItems uint64 `json:"minItems,omitempty" yaml:"minItems,omitempty"`
Default interface{} `json:"default,omitempty" yaml:"default,omitempty"`
Default any `json:"default,omitempty" yaml:"default,omitempty"`
}

func (parameter Parameter) MarshalJSON() ([]byte, error)
Expand All @@ -87,7 +87,7 @@ func (ps Parameters) Less(i, j int) bool
func (ps Parameters) Swap(i, j int)

type PathItem struct {
Extensions map[string]interface{} `json:"-" yaml:"-"`
Extensions map[string]any `json:"-" yaml:"-"`

Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`

Expand All @@ -114,14 +114,14 @@ func (pathItem *PathItem) UnmarshalJSON(data []byte) error
UnmarshalJSON sets PathItem to a copy of data.

type Response struct {
Extensions map[string]interface{} `json:"-" yaml:"-"`
Extensions map[string]any `json:"-" yaml:"-"`

Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`

Description string `json:"description,omitempty" yaml:"description,omitempty"`
Schema *openapi3.SchemaRef `json:"schema,omitempty" yaml:"schema,omitempty"`
Headers map[string]*Header `json:"headers,omitempty" yaml:"headers,omitempty"`
Examples map[string]interface{} `json:"examples,omitempty" yaml:"examples,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Schema *openapi3.SchemaRef `json:"schema,omitempty" yaml:"schema,omitempty"`
Headers map[string]*Header `json:"headers,omitempty" yaml:"headers,omitempty"`
Examples map[string]any `json:"examples,omitempty" yaml:"examples,omitempty"`
}

func (response Response) MarshalJSON() ([]byte, error)
Expand All @@ -133,7 +133,7 @@ func (response *Response) UnmarshalJSON(data []byte) error
type SecurityRequirements []map[string][]string

type SecurityScheme struct {
Extensions map[string]interface{} `json:"-" yaml:"-"`
Extensions map[string]any `json:"-" yaml:"-"`

Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`

Expand All @@ -155,7 +155,7 @@ func (securityScheme *SecurityScheme) UnmarshalJSON(data []byte) error
UnmarshalJSON sets SecurityScheme to a copy of data.

type T struct {
Extensions map[string]interface{} `json:"-" yaml:"-"`
Extensions map[string]any `json:"-" yaml:"-"`

Swagger string `json:"swagger" yaml:"swagger"` // required
Info openapi3.Info `json:"info" yaml:"info"` // required
Expand Down
Loading
Loading