openapi

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalDoc

func MarshalDoc(headers map[string][]string, info Info, server string, resources ...resource.Resource) ([]byte, string)

func MarshalJson

func MarshalJson(info Info, server string, r ...resource.Resource) ([]byte, error)

func MarshalYaml

func MarshalYaml(info Info, server string, r ...resource.Resource) ([]byte, error)

Types

type Components

type Components struct {
	Schemas map[string]Schema `json:"schemas,omitempty" yaml:"schemas,omitempty"`
}

type Content

type Content struct {
	Schema RefSchema `json:"schema,omitempty" yaml:"schema,omitempty"`
}

type DataObject

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

type Info

type Info struct {
	Title          string            `json:"title"`
	Description    string            `json:"description,omitempty" yaml:"description,omitempty"`
	TermsOfService string            `json:"termsOfService,omitempty" yaml:"termsOfService,omitempty"`
	Contact        map[string]string `json:"contact,omitempty" yaml:"contact,omitempty"`
	License        *License          `json:"license,omitempty" yaml:"license,omitempty"`
	Version        string            `json:"version"`
}

type License

type License struct {
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	Url  string `json:"url,omitempty" yaml:"url,omitempty"`
}

type Operation

type Operation struct {
	Description     string                `json:"summary,omitempty" yaml:"summary,omitempty"`
	Responses       map[string]DataObject `json:"responses,omitempty" yaml:"responses,omitempty"`
	QueryParameters []Parameter           `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	RequestBody     *DataObject           `json:"requestBody,omitempty" yaml:"requestBody,omitempty"`
}

type Parameter

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

type Path

type Path map[string]interface{}

type RefSchema

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

type Schema

type Schema struct {
	Type       string            `json:"type,omitempty" yaml:"type,omitempty"`
	Format     string            `json:"format,omitempty" yaml:"format,omitempty"`
	Properties map[string]Schema `json:"properties,omitempty" yaml:"properties,omitempty"`
	Items      *Schema           `json:"items,omitempty" yaml:"items,omitempty"`
}

type Server

type Server struct {
	Url string `json:"url" yaml:"url"`
}

Jump to

Keyboard shortcuts

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