parser

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefinitionNameFromRef added in v0.2.2

func DefinitionNameFromRef(ref oas.Ref) (string, string)

func Enum2string

func Enum2string(enums ...interface{}) string

func Parse added in v0.2.2

func Parse(sourcePath string) (*oas.Swagger, error)

Parse `JSON`, `YAML` to Go struct

func SortMap

func SortMap(hashmap interface{}) []string

Types

type APIHeader added in v0.2.2

type APIHeader struct {
	Tag         string
	ID          string
	Path        string
	Method      string
	Consumes    string
	Produces    string
	Summary     string
	Description string
}

type APIRequest added in v0.2.2

type APIRequest struct {
	Required      string
	Schema        string
	ParameterType string // path, body, query, header, ...
	DataType      string // string, integer, boolean, object, ...
	Enum          string
	Example       string
	Description   string
}

type APIResponse added in v0.2.2

type APIResponse struct {
	StatusCode   string
	Schema       string
	ResponseType string // body
	DataType     string // string, integer, boolean, object, ...
	Enum         string
	Example      string
	Description  string
}

type SwageAPI added in v0.2.2

type SwageAPI struct {
	Header   APIHeader
	Request  []APIRequest
	Response []APIResponse
}

type SwageSpec added in v0.2.2

type SwageSpec struct {
	API []SwageAPI
}

func Convert added in v0.2.2

func Convert(swagger *oas.Swagger) (*SwageSpec, error)

Convert Open API Spec to Swage Spec

Jump to

Keyboard shortcuts

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