Skip to main content

Module fixtures

Module fixtures 

Source
Expand description

Shared test fixture builders for MockForge crates.

Provides reusable utilities for constructing test data that would otherwise be duplicated across every crate’s test modules.

Functions§

fixture_path
Resolve a fixture path relative to the calling crate’s CARGO_MANIFEST_DIR.
minimal_openapi_spec
Create a minimal valid OpenAPI 3.0 spec as a JSON value.
openapi_spec_crud
Create an OpenAPI spec with CRUD operations (GET, POST, PUT, DELETE) for a resource.
openapi_spec_with_get
Create an OpenAPI spec with a single GET endpoint that returns JSON.
write_spec_to
Write a JSON value as an OpenAPI spec file to a specific path.
write_temp_spec
Write a JSON value as an OpenAPI spec file to a temporary directory.