Version: v2.0.301 Latest Latest

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

Go to latest
Published: May 28, 2021 License: MIT Imports: 8 Imported by: 0




This section is empty.


This section is empty.


func DefaultValue

func DefaultValue(typ *spec.TypeDef, valueStr string) interface{}

TODO: Default values provided in spec are actually exactly what should appear in Swagger in the string form.

This value translation string -> go type -> string is only needed because of how OpenAPI spec if formed.
It's possible that after move to yaml.v3 this value translation can be avoided.

func GenerateSpecification

func GenerateSpecification(serviceFile string, outFile string) (err error)

func ToYamlString

func ToYamlString(data interface{}) (string, error)


type MapItem

type MapItem struct {
	// contains filtered or unexported fields

type UrlOperations

type UrlOperations struct {
	Url        string
	Operations []*spec.NamedOperation

func OperationsByUrl

func OperationsByUrl(specification *spec.Spec) []*UrlOperations

type YamlArray

type YamlArray struct {
	Items []interface{}

func Array

func Array() *YamlArray

func (*YamlArray) Add

func (self *YamlArray) Add(value interface{}) *YamlArray

func (*YamlArray) Length

func (self *YamlArray) Length() int

func (*YamlArray) MarshalYAML

func (self *YamlArray) MarshalYAML() (interface{}, error)

type YamlMap

type YamlMap struct {
	Items []MapItem

func Map

func Map() *YamlMap

func OpenApiType

func OpenApiType(typ *spec.TypeDef, defaultValue *string) *YamlMap

func PlainOpenApiType

func PlainOpenApiType(typeInfo *spec.TypeInfo, typ string) *YamlMap

func (*YamlMap) Length

func (self *YamlMap) Length() int

func (*YamlMap) MarshalYAML

func (self *YamlMap) MarshalYAML() (interface{}, error)

func (*YamlMap) Set

func (self *YamlMap) Set(name string, value interface{}) *YamlMap

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL