PYTHON AGENT · JAVA CLIENT CONTRACT

BeeAI-to-Java bridge: preserve a renamed response field

Rename a field in a Python agent response and see whether the Java client fails loudly, silently returns nothing, or keeps working.

Computed drill · sixty inspection seconds

Event trace

    Computed data

    Final metrics

    Model of a JSON-to-record mapping inspired by Jackson settings; it is not BeeAI, Jackson or any HTTP client. Jackson's ObjectMapper fails on unknown properties by default, while Spring Boot's auto-configured mapper ignores them; the selector stands for that choice. A contract test here verifies that the mapping produces a non-null summary.

    A rename that returns nothing

    The Python agent release renames summary to answer and adds schemaVersion. The Java mapper ignores unknown fields, summary is not required, and there is no contract test. Mapping succeeds with summary = null, answer and schemaVersion ignored, and every one of 5 user requests gets an empty answer with HTTP 200 and nothing logged: SILENT EMPTY ANSWERS, 0/5 delivered. Raise User requests after the release to 20 and all 20 are empty. Lenient decoding turned a breaking change into a quiet one. The Response fields and mapping table lists every field in the body and whether it is mapped, ignored or fails the mapping.

    Fail loudly instead

    Set Unknown fields in the Java mapper to Fail on unknown fields: each request hits a deserialization error that is logged, LOUD FAILURES, 0/5 delivered. This mirrors Jackson's ObjectMapper default; Spring Boot's auto-configured mapper ignores unknown properties. Alternatively keep ignore and tick summary is required: the missing value fails each mapping, also loud. A loud failure is not a working client, but it is detected within the first request.

    Make the rename compatible

    Tick Accept answer as an alias for summary: answer maps to summary and all 5 requests are delivered, COMPATIBLE. Load the v2 transition example, which sends both fields: the default client is compatible with no change. Fail on unknown fields breaks it, even with the alias, because schemaVersion is still unknown. v1 works under every setting. Expand-then-contract releases send both fields until every consumer reads the new one.

    Contract tests in the provider pipeline

    Tick Consumer contract test runs in the provider pipeline with the v2 body: the test finds summary would map to null, the release is blocked, responses stay on v1 and all 5 requests are delivered: BREAK CAUGHT BEFORE RELEASE. Load Truncated JSON: without the test every request fails with a parse error; with it the release is blocked too. Add the alias and the same test passes. Load an example response replaces the editable Response body; edit it to try any field set.

    Transport and limits

    Play, Pause, Next event, Restart, Speed and Inspection time walk through the release, the contract check, the mapping and each request; the verdict and metrics appear at 60 s, while the preview states the verdict at once. This models a JSON-to-record mapping inspired by Jackson settings, not BeeAI, Jackson or an HTTP client. Its contract test checks only that summary is non-null; real consumer-driven contracts record each field and type a consumer reads.

    Views are my own and do not represent any employer, past or present.

    Search