Skip to content

[REQ][Go] Check for and do not wrap reflect.Value in parameterAddToHeaderOrQuery function #16614

@mytlogos

Description

@mytlogos

Is your feature request related to a problem? Please describe.

There was a bug where a reflect.Value was wrapped into another reflect.Value, which led to invalid url queries: #14798 .
Though the commit 117e511 solves this problem in a straightforward manner, by unwrapping the reflect.Value to interface{}, it does not seem very "future proof", in the meaning that any other future used reflect.Value, also needs unwrapping.

Describe the solution you'd like

Modify the parameterAddToHeaderOrQuery function in the client golang template to always check if the value to wrap is of reflect.Value and skipping if its true:

        // previously: var v = reflect.ValueOf(obj)
	var v reflect.Value
	if refValue, ok := obj.(reflect.Value); ok {
		v = refValue
	} else {
		v = reflect.ValueOf(obj)
	}

Describe alternatives you've considered

Not doing anything, as the bug itself is fixed and does not warrant any further action.

Additional context

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions