schema

package
v0.4.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormattedOpenAPI

func FormattedOpenAPI(s types.Schema) ([]byte, error)

FormattedOpenAPI generates formatted openapi yaml.

func Generate

func Generate(opts GenerateOption) error

Types

type GenerateOption

type GenerateOption struct {
	Dir string
}

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