Documentation ¶
Index ¶
- func ExpandOperation(operation *openapi3.Operation, oas3 *openapi3.Swagger) error
- func ExpandPaths(oas3 *openapi3.Swagger) error
- func ExpandRequestBody(ref *openapi3.RequestBodyRef, oas3 *openapi3.Swagger) error
- func ExpandResponses(responses openapi3.Responses, oas3 *openapi3.Swagger) error
- func ExpandSchemaRef(ref *openapi3.SchemaRef, oas3 *openapi3.Swagger) error
- func GenExampleFromExpandedSchema(mediaType httputil.ContentType, schema *openapi3.Schema)
- func LoadFromData(data []byte) (*openapi3.Swagger, error)
- func MarshalJson(v3 *openapi3.Swagger) ([]byte, error)
- func MarshalJsonIndent(v3 *openapi3.Swagger, prefix, indent string) ([]byte, error)
- func MarshalYaml(v3 *openapi3.Swagger) ([]byte, error)
- func ValidateComponents(ctx context.Context, components openapi3.Components) error
- func ValidateContact(_ context.Context, _ *openapi3.Contact) error
- func ValidateContent(ctx context.Context, content openapi3.Content) error
- func ValidateHeader(ctx context.Context, header *openapi3.Header) error
- func ValidateHeaderRef(ctx context.Context, ref *openapi3.HeaderRef) error
- func ValidateIdentifier(_ string) error
- func ValidateInfo(ctx context.Context, info *openapi3.Info) error
- func ValidateLicense(_ context.Context, license *openapi3.License) error
- func ValidateMediaType(ctx context.Context, mediaType *openapi3.MediaType) error
- func ValidateOAS3(ctx context.Context, oas3 openapi3.Swagger) error
- func ValidateOAuthFlow(_ context.Context, flow *openapi3.OAuthFlow, typ oAuthFlowType) error
- func ValidateOAuthFlows(ctx context.Context, flows *openapi3.OAuthFlows) error
- func ValidateOperation(ctx context.Context, operation *openapi3.Operation) error
- func ValidateParameter(ctx context.Context, parameter *openapi3.Parameter) error
- func ValidateParameterRef(ctx context.Context, ref *openapi3.ParameterRef) error
- func ValidateParameters(ctx context.Context, parameters openapi3.Parameters) error
- func ValidatePathItem(ctx context.Context, pathItem *openapi3.PathItem) error
- func ValidatePaths(ctx context.Context, paths openapi3.Paths) error
- func ValidateRequestBody(ctx context.Context, requestBody *openapi3.RequestBody) error
- func ValidateRequestBodyRef(ctx context.Context, ref *openapi3.RequestBodyRef) error
- func ValidateResponse(ctx context.Context, response *openapi3.Response) error
- func ValidateResponseRef(ctx context.Context, ref *openapi3.ResponseRef) error
- func ValidateSchema(ctx context.Context, schema *openapi3.Schema, stack []*openapi3.Schema) error
- func ValidateSchemaRef(ctx context.Context, ref *openapi3.SchemaRef, stack []*openapi3.Schema) error
- func ValidateSecurity(ctx context.Context, securities openapi3.SecurityRequirements) error
- func ValidateSecurityRequirement(_ context.Context, _ openapi3.SecurityRequirement) error
- func ValidateSecurityScheme(ctx context.Context, ss *openapi3.SecurityScheme) error
- func ValidateSecuritySchemeRef(ctx context.Context, ref *openapi3.SecuritySchemeRef) error
- func ValidateServer(ctx context.Context, server *openapi3.Server) error
- func ValidateServerVariable(ctx context.Context, serverVariable *openapi3.ServerVariable) error
- func ValidateServers(ctx context.Context, servers openapi3.Servers) error
- type ValidateError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandOperation ¶
ExpandOperation 展开所有 operation 中的请求体和响应体
func ExpandRequestBody ¶
func ExpandRequestBody(ref *openapi3.RequestBodyRef, oas3 *openapi3.Swagger) error
ExpandRequestBody 如果 request body 中引用了 Components, 则将 request body 的结构展开, 直到不再包含任何引用的结构
func ExpandResponses ¶
ExpandResponses 将所有的 response body 都展开
func ExpandSchemaRef ¶
ExpandSchemaRef 展开 SchemaRef
func GenExampleFromExpandedSchema ¶ added in v1.3.0
func GenExampleFromExpandedSchema(mediaType httputil.ContentType, schema *openapi3.Schema)
为 *openapi3.Schema 生成 Example, 就地修改 schema.Example 字段 生成前 Schema 应当是展开的, 不能包含引用
func MarshalJsonIndent ¶
func ValidateComponents ¶
func ValidateComponents(ctx context.Context, components openapi3.Components) error
func ValidateIdentifier ¶
func ValidateMediaType ¶
func ValidateOAuthFlow ¶
func ValidateOAuthFlows ¶
func ValidateOAuthFlows(ctx context.Context, flows *openapi3.OAuthFlows) error
func ValidateOperation ¶
func ValidateParameter ¶
func ValidateParameterRef ¶
func ValidateParameterRef(ctx context.Context, ref *openapi3.ParameterRef) error
func ValidateParameters ¶
func ValidateParameters(ctx context.Context, parameters openapi3.Parameters) error
func ValidatePathItem ¶
func ValidateRequestBody ¶
func ValidateRequestBody(ctx context.Context, requestBody *openapi3.RequestBody) error
func ValidateRequestBodyRef ¶
func ValidateRequestBodyRef(ctx context.Context, ref *openapi3.RequestBodyRef) error
func ValidateResponse ¶
func ValidateResponseRef ¶
func ValidateResponseRef(ctx context.Context, ref *openapi3.ResponseRef) error
func ValidateSchema ¶
func ValidateSchemaRef ¶
func ValidateSecurity ¶
func ValidateSecurity(ctx context.Context, securities openapi3.SecurityRequirements) error
func ValidateSecurityRequirement ¶
func ValidateSecurityRequirement(_ context.Context, _ openapi3.SecurityRequirement) error
func ValidateSecurityScheme ¶
func ValidateSecurityScheme(ctx context.Context, ss *openapi3.SecurityScheme) error
func ValidateSecuritySchemeRef ¶
func ValidateSecuritySchemeRef(ctx context.Context, ref *openapi3.SecuritySchemeRef) error
func ValidateServerVariable ¶
func ValidateServerVariable(ctx context.Context, serverVariable *openapi3.ServerVariable) error
Types ¶
type ValidateError ¶
type ValidateError struct {
// contains filtered or unexported fields
}
func (*ValidateError) Error ¶
func (e *ValidateError) Error() string
func (*ValidateError) Wrap ¶
func (e *ValidateError) Wrap(err error) error
Click to show internal directories.
Click to hide internal directories.