Define what must keep working

AI already returns order records as JSON, and you decide to add a field or clarify an existing name. The change requires checking more than a new response: saved records, the operator’s screen, and imports into your working system must also understand the chosen format. Each recipient may have its own requirements.

Start with two separate questions. Can the updated application read the existing archive? Can the previous application process a new response? Success in one direction proves nothing about the other. For example, a new screen might support both versions while an older importer accepts only the original fields.

The practical preparation deliverable is a migration plan. Record the old and new schema versions, changed fields, data recipients, conversion rule, and stopping conditions. Assign someone to review it. Editors, developers, and operators can then discuss the same changes before the new structure enters the working flow.

Describe the transition using one record

Fictional example: a workshop makes door signs. In version one, text contains the inscription and quantity contains the number of signs. Version two renames text to inscription and adds an optional mounting field: screws means screws, while adhesive means an adhesive backing. Quantity retains its previous meaning and type.

Google’s AIP-180 guidance treats renaming as removing an existing component and adding a new one. Applied to our example, replacing text with inscription cannot be treated as a cosmetic edit. An application looking for text needs support for the new field or a separate data conversion.

Example order P-17 has the inscription “Archive” and a quantity of 2. The conversion rule transfers text into inscription without editing and preserves quantity. Mounting remains absent because the new schema permits this and the earlier record contains no mounting information. An operator must determine the mounting method separately before production.

Check additions in both directions

Official JSON Schema tests demonstrate that describing a field under properties does not make it mandatory; required demands its presence. Adding a new mandatory field can therefore make older records unsuitable for the new schema. An optional field avoids this particular cause of rejection, but does not resolve every migration issue.

Another official test set demonstrates additionalProperties: false: in our example’s flat schema, a field outside the permitted set is rejected. Consequently, the older validator may reject mounting even though it is optional in the new schema. Being optional and permitting unfamiliar fields are separate conditions.

Describe four combinations: old data with the old recipient, old with new, new with old, and new with new. Specify the expected outcome for each. Our example does not allow direct transfer between versions because of the renamed field; the new application must read the archive through the agreed conversion.

Attach a version to each saved response

The proposed approach is for your application to store the schema version alongside the response in its own metadata record. Take that version from the submitted task’s settings. Do not ask the model to decide which version its result belongs to. Schema version describes record structure; model version and message date answer different questions.

For each version, retain its field definitions and associated model instructions. Validate the response against the version requested. If it fails, stop processing. Trying different schemas until one matches can conceal a routing error and assign an inappropriate interpretation to the record.

First place older, unversioned records in a documented group and confirm that the original schema applies. Convert copies while retaining the originals in your own storage. The migration log can record each record’s identifier, source version, target version, conversion rule, and any discrepancies found.

Prepare examples with predetermined outcomes

Prepare six records for an illustrative check. The first is an ordinary version one record. The second contains a line break in its inscription, which conversion must preserve. The third follows version two and specifies screws. The fourth follows version two without mounting. The fifth contains conflicting text and inscription values. The sixth specifies an unknown schema version.

For the first two, write down the exact transfer result for every field. Send the third to the version two recipient and check rejection by the older recipient. The fourth should open without invented mounting information. Require a stop for the fifth’s naming conflict and the sixth’s unsupported version. These are planned checks, not model test results.

Inspect the order screen as well as any import success message: check the inscription, quantity, and availability of mounting selection. Record expected and actual behavior separately. You can prepare these scenarios using fictional data without generations; the real application still needs checking once a developer implements the transition.

Agree on rollout and rollback

The proposed rollout sequence is to prepare a recipient supporting both versions first, then switch new tasks to the second schema. Convert the archive separately if needed. Retire the old version after checking every known recipient, including infrequently used exports and the operator’s working form.

Decide beforehand what happens to new records during rollback. You can retain support for reading them or pause processing until a compatible application is restored. Reverting the model instructions does not convert saved responses. A reverse conversion that removes mounting loses mounting information and requires a separate decision.

The method has limits. Structural compatibility does not confirm extracted facts, and six illustrative records cannot cover the entire flow. Check the selected generation mode’s support for your particular schema separately. The completed migration plan should state which versions are accepted, where conversion is required, and which records go to a person.

Sources