generate

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateYamlFile

func GenerateYamlFile(p ISwaggerSchema, path, filename string) error

func GetSecurity

func GetSecurity(sec []string) []map[string][]interface{}

Types

type Content

type Content struct {
	Schema ContentSchema `yaml:"schema"`
}

type ContentSchema

type ContentSchema []IContentSchema

type IContentSchema

type IContentSchema interface {
	GetString() string
}

type IParameters

type IParameters interface {
	GetString() string
}

type ISwaggerSchema

type ISwaggerSchema interface {
	ToYaml() (string, error)
}

type Parameter

type Parameter struct {
	Name        string          `yaml:"name"`
	In          string          `yaml:"in"`
	Description string          `yaml:"description,omitempty"`
	Required    bool            `yaml:"required"`
	Schema      ParameterSchema `yaml:"schema"`
}

func (*Parameter) GetString

func (p *Parameter) GetString() string

type ParameterSchema

type ParameterSchema map[string]string

type Parameters

type Parameters []IParameters

Parameters is an alias for type Parameter or RefParameter

type RefParameter

type RefParameter struct {
	Ref string `yaml:"$ref"`
}

func (*RefParameter) GetString

func (r *RefParameter) GetString() string

type RefSchema

type RefSchema struct {
	Ref string `yaml:"$ref"`
}

func (*RefSchema) GetString

func (r *RefSchema) GetString() string

func (*RefSchema) ReadRef

func (r *RefSchema) ReadRef(cmd *cobra.Command, scanner *bufio.Scanner)

type RequestBody

type RequestBody struct {
	Description string             `yaml:"description"`
	Content     map[string]Content `yaml:"content"`
}

func (*RequestBody) GetString

func (r *RequestBody) GetString() string

func (*RequestBody) ReadDescription

func (r *RequestBody) ReadDescription(cmd *cobra.Command, scanner *bufio.Scanner)

type Response

type Response struct {
	Description string             `yaml:"description,omitempty"`
	Content     map[string]Content `yaml:"content"`
}

type Responses

type Responses map[string]Response

type Schema

type Schema struct {
	Type       string            `yaml:"type"`
	Format     string            `yaml:"format,omitempty"`
	Properties map[string]Schema `yaml:"properties,omitempty"`
	Required   []string          `yaml:"required,omitempty"`
	Nullable   bool              `yaml:"nullable,omitempty"`
	Items      *Schema           `yaml:"items,omitempty"`
}

func NewSchema

func NewSchema() *Schema

func (*Schema) GetString

func (s *Schema) GetString() string

func (*Schema) ReadFormat

func (s *Schema) ReadFormat(cmd *cobra.Command, t string)

func (*Schema) ReadItems

func (s *Schema) ReadItems(cmd *cobra.Command, scanner *bufio.Scanner, isModel bool)

func (*Schema) ReadProperties

func (s *Schema) ReadProperties(cmd *cobra.Command, scanner *bufio.Scanner, isModel bool)

func (*Schema) ReadType

func (s *Schema) ReadType(cmd *cobra.Command)

type Security

type Security = map[string][]interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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