The idea
Describe the task, permitted source information and required output fields separately. A structured response makes downstream checks easier, but valid JSON does not imply correct facts. Decide which fields are required, which may be unknown and what an acceptable value looks like before asking a model to generate the response.
Worked example
A fictional support message says a parcel arrived damaged but gives no order number. Request fields for issue, orderId and needsFollowUp. The issue can be damaged parcel, orderId should be null and needsFollowUp should be true. A realistic-looking invented order number would fail the contract even if the JSON parses.
Try it
Write a prompt for classifying three fictional support messages. Define three output fields and their allowed values. Include one message with missing information and specify how unknown values must be represented. Check each output against the source, not just its shape.
