schema

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindResponseSchema

func FindResponseSchema(t *testing.T, paths []*framework.Path, pathIdx int, operation logical.Operation) *framework.Response

FindResponseSchema is a test helper to extract response schema from the given framework path / operation.

func GetResponseSchema added in v0.8.0

func GetResponseSchema(t *testing.T, path *framework.Path, operation logical.Operation) *framework.Response

func ResponseValidatingCallback added in v0.9.0

func ResponseValidatingCallback(t *testing.T) func(logical.Backend, *logical.Request, *logical.Response)

ResponseValidatingCallback can be used in setting up a vault.TestCluster that validates every response against the openapi specifications.

func ValidateResponse

func ValidateResponse(t *testing.T, schema *framework.Response, response *logical.Response, strict bool)

ValidateResponse is a test helper that validates whether the given response object conforms to the response schema (schema.Fields). It cycles through the data map and validates conversions in the schema. In "strict" mode, this function will also ensure that the data map has all schema-required fields and does not have any fields outside of the schema.

func ValidateResponseData

func ValidateResponseData(t *testing.T, schema *framework.Response, data map[string]interface{}, strict bool)

ValidateResponseData is a test helper that validates whether the given response data map conforms to the response schema (schema.Fields). It cycles through the data map and validates conversions in the schema. In "strict" mode, this function will also ensure that the data map has all schema's requred fields and does not have any fields outside of the schema.

Types

This section is empty.

Jump to

Keyboard shortcuts

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