Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormattedOpenAPI ¶
func FormattedOpenAPI(originSchema, fileSchema *types.TemplateVersionSchema) ([]byte, error)
FormattedOpenAPI generates formatted openapi yaml.
func Generate ¶
func Generate(opts GenerateOption) error
Types ¶
type GenerateOption ¶
type GenerateOption struct {
Dir string
}
func (*GenerateOption) AddFlags ¶ added in v0.5.0
func (o *GenerateOption) AddFlags(cmd *cobra.Command)
type WrapComponents ¶
type WrapComponents struct {
Schemas map[string]any `json:"schemas,omitempty" yaml:"schemas,omitempty"`
}
WrapComponents is a wrapper of openapi3.Components, used to generated formatted yaml.
type WrapInfo ¶
type WrapInfo struct { Title string `json:"title" yaml:"title"` Extensions map[string]any `json:",inline" yaml:",inline"` }
WrapInfo is a wrapper of openapi3.Info and removed field version, used to generated formatted yaml.
type WrapOpenAPI ¶
type WrapOpenAPI struct { OpenAPI string `json:"openapi" yaml:"openapi"` Info WrapInfo `json:"info" yaml:"info"` Components WrapComponents `json:"components,omitempty" yaml:"components,omitempty"` }
WrapOpenAPI is a wrapper of openapi3.T, used to generated formatted yaml.
Click to show internal directories.
Click to hide internal directories.