validation

package
v0.0.0-...-1ebf370 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CHValidator

type CHValidator interface {
	ValidateRequestAgainstOpenApiSpec(httpReq *http.Request, contextId string) ([]byte, error)
}

CHValidator provides an interface to interact with the CH Validator.

func NewCHValidator

func NewCHValidator(openApiSpec string) (CHValidator, error)

NewCHValidator returns a new CHValidator implementation.

type CHValidatorImpl

type CHValidatorImpl struct {
	// contains filtered or unexported fields
}

CHValidatorImpl is a concrete implementation of the CHValidator interface.

func (CHValidatorImpl) ValidateRequestAgainstOpenApiSpec

func (chv CHValidatorImpl) ValidateRequestAgainstOpenApiSpec(httpReq *http.Request, contextId string) ([]byte, error)

ValidateRequestAgainstOpenApiSpec takes a request and uses an openAPI3 spec to validate the request's body. If any validation errors are found, then they are formatted and returned to the caller. If any errors are encountered while attempting to validate, then they are handled and also returned to the caller.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
schema_testing
common
common contains common functions which can be used when unit testing schemas to make them more compact and easy to implement.
common contains common functions which can be used when unit testing schemas to make them more compact and easy to implement.
psc

Jump to

Keyboard shortcuts

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