convert

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Array

func Array(vals []string, itemsType, itemsFormat string) (value interface{}, err error)

Array converts array of strings according to type and format of array items type described in OAS 2.0. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject

Example
values := []string{"123", "456"}
v, _ := Array(values, "integer", "int64")

fmt.Printf("%#v", v)
Output:

[]int64{123, 456}

func Parameter

func Parameter(vals []string, param *spec.Parameter) (value interface{}, err error)

Parameter converts parameter's value(s) according to parameter's type and format. Type and format MUST match OAS 2.0. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject

func Primitive

func Primitive(val string, typ, format string) (value interface{}, err error)

Primitive converts string values according to type and format described in OAS 2.0. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#parameterObject

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL