Skip to content

Commit

Permalink
openapi3,openapi3filter: replace interface{} with any (#1040)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear authored Dec 11, 2024
1 parent b82c647 commit 20441ea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion openapi3/issue82_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func TestIssue82(t *testing.T) {
payload := map[string]interface{}{
payload := map[string]any{
"prop1": "val",
"prop3": "val",
}
Expand Down
2 changes: 1 addition & 1 deletion openapi3/refs_issue247_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ components:
require.NoError(t, err)

var ptr jsonpointer.Pointer
var v interface{}
var v any
var kind reflect.Kind

ptr, err = jsonpointer.New("/paths")
Expand Down
2 changes: 1 addition & 1 deletion openapi3filter/validate_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func appendToQueryValues[T any](q url.Values, parameterName string, v []T) {
// populateDefaultQueryParameters populates default values inside query parameters, while ensuring types are respected
func populateDefaultQueryParameters(q url.Values, parameterName string, value any) {
switch t := value.(type) {
case []interface{}:
case []any:
appendToQueryValues(q, parameterName, t)
default:
q.Add(parameterName, fmt.Sprintf("%v", value))
Expand Down

0 comments on commit 20441ea

Please sign in to comment.