oas3

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Common type constants for convenience

View Source
var DefaultErrorDesc = "Error response."
View Source
var DefaultResponseDesc = "Successful response."
View Source
var (
	ErrInvalidType = fmt.Errorf("invalid type")
)

Functions

func ConvertPath

func ConvertPath(path string) string

func GetDoc

func GetDoc(p *plugin.Plugin, errorType string) (*openapi3.T, error)

func GetMapValueType

func GetMapValueType(typ string) (string, error)

GetMapValueType map[[2]string][]string -> []string

func GetProperty

func GetProperty(properties map[string]string, key string) string

func IsUint

func IsUint(format string) bool

func MergeRequired

func MergeRequired(rs ...[]string) []string

MergeRequired merge schema required fields

func ParseInteger

func ParseInteger(format string, s string) (float64, error)

func ParseNumber

func ParseNumber(format string, s string) (float64, error)

func ParseValue

func ParseValue(typ string, format string, s string) (interface{}, error)

func ParseValueFromType

func ParseValueFromType(typ *openapi3.Types, format string, s string) (interface{}, error)

ParseValueFromType parses value based on schema type pointer

func TypePointer

func TypePointer(t string) *openapi3.Types

TypePointer 辅助函数,将类型转换为 *openapi3.Types

Types

type DefaultErrorResponse

type DefaultErrorResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Define a default error response structure

Jump to

Keyboard shortcuts

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