Migrating to 0.4.0

Existing 0.3.0 decoding and schema APIs continue to work. The required Compact or Pretty argument to to_string and schema_string is unchanged.

Component boundaries

Boundary(a, response) binds a definition to a private handler receiving decoded a and original Json. Construct it with boundary, inspect the stored contract with boundary_definition, and submit JSON with forward. Decoding occurs once before a successful handler invocation.

JsonBoundary(a, response) serves handlers that need only verified JSON. Construct it with json_boundary, inspect it with json_boundary_definition, and submit admitted JSON with forward_json. It validates once without conversion and invokes the handler with VerifiedJson(a) only on success. The receiving definition is authoritative; another contract’s certificate cannot bypass this check.

verify(definition, json) creates a certificate independently. Use verified_json and verified_definition to retrieve its original JSON and actual checked contract. Certificates retain no decoded value. The parameter a describes a definition’s output type, not its identity or constraints. Boundary handlers returning Result produce nested results; callback exceptions remain operational failures.

See Verified JSON boundaries for complete examples.

Added schema vocabulary

These operations preserve the associated definition’s decoded output type. Details and composition restrictions are in Advanced definitions.

✨ Search Document