openapi2apisix

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LoadOpenAPIError  is the error type for loading OpenAPI
	LoadOpenAPIError = errors.New("load OpenAPI file error")
)

Functions

func Convert

func Convert(ctx context.Context, oas []byte) (*apitypes.Configuration, error)

Convert converts OAS to API Service and Routes

func Slugify

func Slugify(name ...string) string

Slugify converts a name to a valid name by removing and replacing unallowed characters and sanitizing non-latin characters. Multiple inputs will be concatenated using '_'.

Types

type OAS

type OAS []byte

func (OAS) LoadOpenAPI

func (s OAS) LoadOpenAPI(ctx context.Context) (*openapi3.T, error)

type ResultBundle

type ResultBundle struct {
	Services []*apitypes.Service `json:"service"`
	Routes   []*apitypes.Route   `json:"routes"`
}

Jump to

Keyboard shortcuts

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