View Source OpenApiSpex.TestAssertions (open_api_spex v3.16.4)
Defines helpers for testing API responses and examples against API spec schemas.
Link to this section Summary
Functions
Asserts that value
is a valid request schema with title schema_title
in api_spec
. In this case,
the presence of required readOnly
fields is not validated.
Asserts that value
is a valid response schema with title schema_title
in api_spec
. In this case,
the presence of required writeOnly
fields is not validated.
Asserts that value
conforms to the schema in the given %Cast{}
context.
Asserts that value
conforms to the schema with title schema_title
in api_spec
.
Link to this section Functions
@spec assert_request_schema(term(), String.t(), OpenApiSpex.OpenApi.t()) :: term() | no_return()
Asserts that value
is a valid request schema with title schema_title
in api_spec
. In this case,
the presence of required readOnly
fields is not validated.
@spec assert_response_schema(term(), String.t(), OpenApiSpex.OpenApi.t()) :: term() | no_return()
Asserts that value
is a valid response schema with title schema_title
in api_spec
. In this case,
the presence of required writeOnly
fields is not validated.
@spec assert_schema(OpenApiSpex.Cast.t()) :: term()
Asserts that value
conforms to the schema in the given %Cast{}
context.
assert_schema(value, schema_title, api_spec, read_write_scope \\ nil)
View Source@spec assert_schema( term(), String.t(), OpenApiSpex.OpenApi.t(), OpenApiSpex.Cast.read_write_scope() ) :: term() | no_return()
Asserts that value
conforms to the schema with title schema_title
in api_spec
.