{"modulePath":"github.com/hexdigest/oapi-codegen","version":"v1.8.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package runtime\n\nCopyright 2021 DeepMap, Inc.\n\nLicensed 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\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless 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.\n\nCopyright 2019 DeepMap, Inc.\n\nLicensed 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\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless 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.\n\nCopyright 2019 DeepMap, Inc.\n\nLicensed 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\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless 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.\n\nCopyright 2019 DeepMap, Inc.\n\nLicensed 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\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless 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.\n\n## Functions\n\n```go\nfunc BindQueryParameter(style string, explode bool, required bool, paramName string,\n\tqueryParams url.Values, dest interface{}) error\n```\nThis 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\u0026firstName=Alex (unexploded) /users?id=role,admin,firstName,Alex\n\nIn 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.\n\n```go\nfunc BindStringToObject(src string, dst interface{}) error\n```\nThis function 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.\n\n```go\nfunc BindStyledParameter(style string, explode bool, paramName string,\n\tvalue string, dest interface{}) error\n```\nThis function binds a parameter as described in the Path Parameters section here to a Go object: [https://swagger.io/docs/specification/serialization/](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.\n\n```go\nfunc BindStyledParameterWithLocation(style string, explode bool, paramName string,\n\tparamLocation ParamLocation, value string, dest interface{}) error\n```\nThis function binds a parameter as described in the Path Parameters section here to a Go object: [https://swagger.io/docs/specification/serialization/](https://swagger.io/docs/specification/serialization/)\n\n```go\nfunc MarshalDeepObject(i interface{}, paramName string) (string, error)\n```\n\n```go\nfunc StyleParam(style string, explode bool, paramName string, value interface{}) (string, error)\n```\nThis function 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.\n\n```go\nfunc StyleParamWithLocation(style string, explode bool, paramName string, paramLocation ParamLocation, value interface{}) (string, error)\n```\nGiven 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\n\n```go\nfunc UnmarshalDeepObject(dst interface{}, paramName string, params url.Values) error\n```\n\n## Types\n\n```go\ntype Binder interface {\n\tBind(src string) error\n}\n```\nBinder 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.\n\nBy convention, to approximate the behavior of Bind functions themselves, Binder implements Bind(\"\") as a no-op.\n\n```go\ntype ParamLocation int\n```\nParameter escaping works differently based on where a header is found\n\n```go\nconst (\n\tParamLocationUndefined ParamLocation = iota\n\tParamLocationQuery\n\tParamLocationPath\n\tParamLocationHeader\n\tParamLocationCookie\n)\n```\n\n","path":"github.com/hexdigest/oapi-codegen/pkg/runtime","name":"runtime","synopsis":"","isRedistributable":true}
