validator

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestCaseValidator added in v0.3.0

type TestCaseValidator struct {
	Validator
	// contains filtered or unexported fields
}

TestCaseValidator is the test-specific validation, which includes a reference to the current testing.T

func (TestCaseValidator) Validate added in v0.3.0

func (v TestCaseValidator) Validate(rr *httptest.ResponseRecorder, req *http.Request)

Validate validates that the given request and recorded response match the configured OpenAPI specification. If any validation errors are found, the test will be failed

type Validator

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

Validator Validator is a container struct for the configuration for a given OpenAPI specification

func NewValidator

func NewValidator(openapi *openapi3.T) Validator

NewValidator Construct a new Validator

func NewValidatorWithAuthenticator added in v0.2.0

func NewValidatorWithAuthenticator(openapi *openapi3.T, authenticationFunc openapi3filter.AuthenticationFunc) Validator

NewValidatorWithAuthenticator Construct a new Validator, with custom AuthenticatorFunc for the `openapi3filter`

func (Validator) ForTest added in v0.3.0

func (v Validator) ForTest(t testingT, rr *httptest.ResponseRecorder, req *http.Request) TestCaseValidator

ForTest Construct a new TestCaseValidator for the specific test. Automagically performs Validate call.

Jump to

Keyboard shortcuts

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