docgen

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PADDING = `	`
View Source
var (
	TRUNCATE_SIZE = 88
)

Functions

func ActionInputString

func ActionInputString(doc *openapi3.T, info *info.Info, op *openapi3.Operation) string

func ActionOutputString

func ActionOutputString(doc *openapi3.T, info *info.Info, res *openapi3.ResponseRef, name string) string

func TypeString

func TypeString(doc *openapi3.T, info *info.Info, ref *openapi3.SchemaRef) string

func WriteDoc

func WriteDoc(w io.Writer, doc *Doc) error

Types

type Doc

type Doc struct {
	Title       string
	Version     string
	Description string

	Endpoints []Endpoint
	HTMLs     []HTMLEndpoint
	Objects   []Object

	SkipMetadata bool // skip header metadata
}

func Generate

func Generate(doc *openapi3.T, info *info.Info) *Doc

type DocumentInfo

type DocumentInfo struct {
	Summary     string
	Description string
}

type Endpoint

type Endpoint struct {
	Method      string
	Path        string
	OperationID string
	DocumentInfo

	HtmlID string
	Tags   string

	Input      Object
	OutputList []Object
	HasExample bool

	GoPositionURL string
}

type Example

type Example struct {
	Title       string
	Description string
	Value       string
}

type HTMLEndpoint

type HTMLEndpoint Endpoint
type Link = info.Link

type Object

type Object struct {
	Name        string
	TypeExpr    string
	TypeString  string
	ContentType string
	DocumentInfo

	HtmlID   string
	Links    []Link
	Examples []Example
}

Jump to

Keyboard shortcuts

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