schema

package
v0.5.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

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.

Jump to

Keyboard shortcuts

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