Documentation
¶
Index ¶
Constants ¶
View Source
const OpenApiVersion = "3.0.0"
Variables ¶
This section is empty.
Functions ¶
func InterfaceToType ¶
func InterfaceToType(data interface{}) string
Types ¶
type Content ¶
type Content struct {
Schema *Schema `json:"schema,omitempty" yaml:"schema,omitempty"`
}
Content represents a content in the spec
func (*Content) UpdateContent ¶
UpdateContent updates a content
type Info ¶
type Method ¶
type Method struct {
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
Responses map[int]*Response `json:"responses,omitempty" yaml:"responses,omitempty"`
Parameters []*Parameter `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}
Operation represents an operation in the spec
func (*Method) UpdateMethod ¶
func (m *Method) UpdateMethod(reqRes RequestResponse)
UpdateMethod updates a method
type Parameter ¶
type Parameter struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
In string `json:"in,omitempty" yaml:"in,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
Schema *Schema `json:"schema,omitempty" yaml:"schema,omitempty"`
}
Parameter represents a parameter in the spec
func NewParameters ¶
NewParameters creates a new parameters
type RequestResponse ¶
RequestResponse represents a request and response
type Response ¶
type Response struct {
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Content map[string]*Content `json:"content,omitempty" yaml:"content,omitempty"`
}
Response represents a response in the spec
func NewResponse ¶
NewResponse creates a new response
func (*Response) UpdateResponse ¶
UpdateResponse updates a response
type Schema ¶
type Schema struct {
Type string `json:"type" yaml:"type"`
Properties map[string]*Schema `json:"properties,omitempty" yaml:"properties,omitempty"`
Description string `json:"description" yaml:"description,omitempty"`
}
Schema represents a schema in the spec
type Server ¶
type Spec ¶
type Spec struct {
OpenApi string `json:"openapi"`
Info *Info `json:"info"`
Servers []*Server `json:"servers"`
Paths map[string]Path `json:"paths"`
}
Spec represents openapi 3 specification
func (*Spec) AddPath ¶
func (s *Spec) AddPath(reqRes RequestResponse)
AddPath adds a path to the spec
Click to show internal directories.
Click to hide internal directories.