genopenapi

package
v1.10.87 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 NewEnumItem

func NewEnumItem(name string, description *string) *spec.NamedEnumItem

func NewField

func NewField(name string, typ spec.TypeDef, description *string) *spec.NamedDefinition

func NewName

func NewName(source string) spec.Name

func NewObject

func NewObject(fields spec.NamedDefinitions, description *string) *spec.Object

func NewOneOf

func NewOneOf(items spec.NamedDefinitions, description *string) *spec.OneOf

func NewParam

func NewParam(name string, typ spec.TypeDef, defaultValue *string, description *string) *spec.NamedParam

func NewResponse

func NewResponse(name string, typ spec.TypeDef, description *string) *spec.NamedResponse

Types

type Group

type Group struct {
	Url        string
	Operations []Operation
}

func Groups

func Groups(apis spec.Apis) []*Group

type Operation

type Operation struct {
	Api       spec.Api
	Operation spec.NamedOperation
}

type YamlArray

type YamlArray struct {
	Yaml []interface{}
}

func Array

func Array() *YamlArray

func (*YamlArray) Add

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

func (*YamlArray) Length

func (self *YamlArray) Length() int

type YamlMap

type YamlMap struct {
	Yaml []yaml.MapItem
}

func Map

func Map() *YamlMap

func OpenApiType

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

func PlainOpenApiType

func PlainOpenApiType(typ string) *YamlMap

func (*YamlMap) Set

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

func (*YamlMap) String

func (self *YamlMap) String() string

Jump to

Keyboard shortcuts

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