Skip to content

Commit 7ec3129

Browse files
authored
Replace interface{} with any (#966)
1 parent 3aa9b4e commit 7ec3129

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1010
-1013
lines changed

.github/docs/openapi2.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func (header *Header) UnmarshalJSON(data []byte) error
2020
UnmarshalJSON sets Header to a copy of data.
2121

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

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

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

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

@@ -61,15 +61,15 @@ type Parameter struct {
6161
ExclusiveMax bool `json:"exclusiveMaximum,omitempty" yaml:"exclusiveMaximum,omitempty"`
6262
Schema *openapi3.SchemaRef `json:"schema,omitempty" yaml:"schema,omitempty"`
6363
Items *openapi3.SchemaRef `json:"items,omitempty" yaml:"items,omitempty"`
64-
Enum []interface{} `json:"enum,omitempty" yaml:"enum,omitempty"`
64+
Enum []any `json:"enum,omitempty" yaml:"enum,omitempty"`
6565
MultipleOf *float64 `json:"multipleOf,omitempty" yaml:"multipleOf,omitempty"`
6666
Minimum *float64 `json:"minimum,omitempty" yaml:"minimum,omitempty"`
6767
Maximum *float64 `json:"maximum,omitempty" yaml:"maximum,omitempty"`
6868
MaxLength *uint64 `json:"maxLength,omitempty" yaml:"maxLength,omitempty"`
6969
MaxItems *uint64 `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`
7070
MinLength uint64 `json:"minLength,omitempty" yaml:"minLength,omitempty"`
7171
MinItems uint64 `json:"minItems,omitempty" yaml:"minItems,omitempty"`
72-
Default interface{} `json:"default,omitempty" yaml:"default,omitempty"`
72+
Default any `json:"default,omitempty" yaml:"default,omitempty"`
7373
}
7474

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

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

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

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

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

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

121-
Description string `json:"description,omitempty" yaml:"description,omitempty"`
122-
Schema *openapi3.SchemaRef `json:"schema,omitempty" yaml:"schema,omitempty"`
123-
Headers map[string]*Header `json:"headers,omitempty" yaml:"headers,omitempty"`
124-
Examples map[string]interface{} `json:"examples,omitempty" yaml:"examples,omitempty"`
121+
Description string `json:"description,omitempty" yaml:"description,omitempty"`
122+
Schema *openapi3.SchemaRef `json:"schema,omitempty" yaml:"schema,omitempty"`
123+
Headers map[string]*Header `json:"headers,omitempty" yaml:"headers,omitempty"`
124+
Examples map[string]any `json:"examples,omitempty" yaml:"examples,omitempty"`
125125
}
126126

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

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

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

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

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

160160
Swagger string `json:"swagger" yaml:"swagger"` // required
161161
Info openapi3.Info `json:"info" yaml:"info"` // required

0 commit comments

Comments
 (0)