Documentation ¶
Overview ¶
Copyright 2021 DeepMap, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 DeepMap, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 DeepMap, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 DeepMap, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func BindForm(ptr interface{}, form map[string][]string, ...) errordeprecated
- func BindMultipart(ptr interface{}, reader multipart.Reader) errordeprecated
- func BindQueryParameter(style string, explode bool, required bool, paramName string, ...) errordeprecated
- func BindStringToObject(src string, dst interface{}) errordeprecated
- func BindStyledParameter(style string, explode bool, paramName string, value string, dest interface{}) errordeprecated
- func BindStyledParameterWithLocation(style string, explode bool, paramName string, paramLocation ParamLocation, ...) errordeprecated
- func JsonMerge(data, patch json.RawMessage) (json.RawMessage, error)deprecated
- func MarshalDeepObject(i interface{}, paramName string) (string, error)deprecated
- func MarshalForm(ptr interface{}, encodings map[string]RequestBodyEncoding) (url.Values, error)deprecated
- func StyleParam(style string, explode bool, paramName string, value interface{}) (string, error)deprecated
- func StyleParamWithLocation(style string, explode bool, paramName string, paramLocation ParamLocation, ...) (string, error)deprecated
- func UnmarshalDeepObject(dst interface{}, paramName string, params url.Values) errordeprecated
- type Binderdeprecated
- type ParamLocationdeprecated
- type RequestBodyEncodingdeprecated
- type StrictEchoHandlerFuncdeprecated
- type StrictEchoMiddlewareFuncdeprecated
- type StrictGinHandlerFuncdeprecated
- type StrictGinMiddlewareFuncdeprecated
- type StrictHttpHandlerFuncdeprecated
- type StrictHttpMiddlewareFuncdeprecated
- type StrictIrisHandlerFuncdeprecated
- type StrictIrisMiddlewareFuncdeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindForm
deprecated
added in
v1.12.0
func BindForm(ptr interface{}, form map[string][]string, files map[string][]*multipart.FileHeader, encodings map[string]RequestBodyEncoding) error
Deprecated: This has been replaced by github.com/oapi-codegen/runtime#BindForm
func BindMultipart
deprecated
added in
v1.12.0
func BindQueryParameter
deprecated
func BindQueryParameter(style string, explode bool, required bool, paramName string, queryParams url.Values, dest interface{}) error
BindQueryParameter works much like BindStyledParameter, however it takes a query argument input array from the url package, since query arguments come through a different path than the styled arguments. They're also exceptionally fussy. For example, consider the exploded and unexploded form parameter examples: (exploded) /users?role=admin&firstName=Alex (unexploded) /users?id=role,admin,firstName,Alex
In the first case, we can pull the "id" parameter off the context, and unmarshal via json as an intermediate. Easy. In the second case, we don't have the id QueryParam present, but must find "role", and "firstName". what if there is another parameter similar to "ID" named "role"? We can't tell them apart. This code tries to fail, but the moral of the story is that you shouldn't pass objects via form styled query arguments, just use the Content parameter form.
Deprecated: This has been replaced by github.com/oapi-codegen/runtime#BindQueryParameter
func BindStringToObject
deprecated
BindStringToObject takes a string, and attempts to assign it to the destination interface via whatever type conversion is necessary. We have to do this via reflection instead of a much simpler type switch so that we can handle type aliases. This function was the easy way out, the better way, since we know the destination type each place that we use this, is to generate code to read each specific type.
Deprecated: This has been replaced by github.com/oapi-codegen/runtime#BindStringToObject
func BindStyledParameter
deprecated
func BindStyledParameter(style string, explode bool, paramName string, value string, dest interface{}) error
BindStyledParameter binds a parameter as described in the Path Parameters section here to a Go object: https://swagger.io/docs/specification/serialization/ It is a backward compatible function to clients generated with codegen up to version v1.5.5. v1.5.6+ calls the function below.
Deprecated: This has been replaced by github.com/oapi-codegen/runtime#BindStyledParameter
func BindStyledParameterWithLocation
deprecated
added in
v1.5.6
func BindStyledParameterWithLocation(style string, explode bool, paramName string, paramLocation ParamLocation, value string, dest interface{}) error
BindStyledParameterWithLocation binds a parameter as described in the Path Parameters section here to a Go object: https://swagger.io/docs/specification/serialization/
Deprecated: This has been replaced by github.com/oapi-codegen/runtime#BindStyledParameterWithLocation
func JsonMerge
deprecated
added in
v1.12.0
func JsonMerge(data, patch json.RawMessage) (json.RawMessage, error)
JsonMerge merges two JSON representation into a single object. `data` is the existing representation and `patch` is the new data to be merged in
Deprecated: This has been replaced by github.com/oapi-codegen/runtime#JsonMerge
func MarshalDeepObject
deprecated
added in
v1.3.6
func MarshalForm
deprecated
added in
v1.12.0
func MarshalForm(ptr interface{}, encodings map[string]RequestBodyEncoding) (url.Values, error)
Deprecated: This has been replaced by github.com/oapi-codegen/runtime#MarshalForm
func StyleParam
deprecated
added in
v1.1.0
StyleParam is used by older generated code, and must remain compatible with that code. It is not to be used in new templates. Please see the function below, which can specialize its output based on the location of the parameter.
Deprecated: This has been replaced by github.com/oapi-codegen/runtime#StyleParam
func StyleParamWithLocation
deprecated
added in
v1.5.6
func StyleParamWithLocation(style string, explode bool, paramName string, paramLocation ParamLocation, value interface{}) (string, error)
Given an input value, such as a primitive type, array or object, turn it into a parameter based on style/explode definition, performing whatever escaping is necessary based on parameter location
Deprecated: This has been replaced by github.com/oapi-codegen/runtime#StyleParam
func UnmarshalDeepObject
deprecated
added in
v1.3.6
Types ¶
type Binder
deprecated
added in
v1.5.0
Binder is the interface implemented by types that can be bound to a query string or a parameter string The input can be assumed to be a valid string. If you define a Bind method you are responsible for all data being completely bound to the type.
By convention, to approximate the behavior of Bind functions themselves, Binder implements Bind("") as a no-op.
Deprecated: This has been replaced by github.com/oapi-codegen/runtime#Binder
type ParamLocation
deprecated
added in
v1.5.6
type ParamLocation int
Parameter escaping works differently based on where a header is found
Deprecated: This has been replaced by github.com/oapi-codegen/runtime#ParamLocation
const ( ParamLocationUndefined ParamLocation = iota ParamLocationQuery ParamLocationPath ParamLocationHeader ParamLocationCookie )
type RequestBodyEncoding
deprecated
added in
v1.12.0
type StrictEchoHandlerFunc
deprecated
added in
v1.13.0
type StrictEchoHandlerFunc func(ctx echo.Context, request interface{}) (response interface{}, err error)
Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/echo#StrictEchoHandlerFunc
type StrictEchoMiddlewareFunc
deprecated
added in
v1.13.0
type StrictEchoMiddlewareFunc func(f StrictEchoHandlerFunc, operationID string) StrictEchoHandlerFunc
Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/echo#StrictEchoMiddlewareFunc
type StrictGinHandlerFunc
deprecated
added in
v1.13.0
type StrictGinMiddlewareFunc
deprecated
added in
v1.13.0
type StrictGinMiddlewareFunc func(f StrictGinHandlerFunc, operationID string) StrictGinHandlerFunc
Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/gin#StrictGinMiddlewareFunc
type StrictHttpHandlerFunc
deprecated
added in
v1.13.0
type StrictHttpMiddlewareFunc
deprecated
added in
v1.13.0
type StrictHttpMiddlewareFunc func(f StrictHttpHandlerFunc, operationID string) StrictHttpHandlerFunc
Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/nethttp#StrictHttpMiddlewareFunc
type StrictIrisHandlerFunc
deprecated
added in
v1.14.0
type StrictIrisHandlerFunc func(ctx iris.Context, request interface{}) (response interface{}, err error)
Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/iris#StrictIrisHandlerFunc
type StrictIrisMiddlewareFunc
deprecated
added in
v1.14.0
type StrictIrisMiddlewareFunc func(f StrictIrisHandlerFunc, operationID string) StrictIrisHandlerFunc
Deprecated: This has been replaced by github.com/oapi-codegen/runtime/strictmiddleware/iris#StrictIrisMiddlewareFunc