{"id":3342,"date":"2026-11-28T16:12:23","date_gmt":"2026-11-28T16:12:23","guid":{"rendered":"https:\/\/danieldreitberg.com\/?p=3342"},"modified":"2026-11-28T16:12:23","modified_gmt":"2026-11-28T16:12:23","slug":"dr-ai-dc05f788a5ae8f9cbfe7","status":"publish","type":"post","link":"https:\/\/danieldreitberg.com\/index.php\/2026\/11\/28\/dr-ai-dc05f788a5ae8f9cbfe7\/","title":{"rendered":"Show an API Problem Without Turning Its Detail Into a Headline"},"content":{"rendered":"<p>A contact-sheet generator returns a structured error instead of the PDF the editor requested. The response is valid JSON, so an AI step treats the error&#8217;s detail as a headline for the new contact sheet. Parse the error for the recovery flow, not as one of the requested editorial records.<\/p>\n<p>Reference: <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc9457.html\">RFC 9457 Problem Details<\/a>. RFC 9457 defines a structured way to describe problems in HTTP APIs.<\/p>\n<h2>Adopt RFC 9457 structure<\/h2>\n<p>Use the expected response status and media type to route the result. RFC 9457 defines a problem details representation with members such as type, title and detail; it is not the same payload as a successful export. When an integration recognizes a documented problem type, give the editor an appropriate next step. Do not assume the detail is fit to publish or rely on it to decide what type of error occurred. Provide reader-safe wording and keep diagnostic information in its authorized context without exposing request data or internal implementation details.<\/p>\n<h2>Validate structured output<\/h2>\n<p>In a fictional service, use one response that contains the expected document and another that contains a known problem indicating a required input is missing. The second should show a correction path and leave the export incomplete. Try an unfamiliar problem type and a non-JSON failure, and verify that both get a safe fallback message rather than entering the writing step. Confirm that the expected file can be opened before showing a successful download. No test should put a diagnostic string into a public article.<\/p>\n<p>Keep the response contract and the editorial result in separate records. A well-formed error can be useful information for the operator without representing an accepted deliverable.<\/p>\n<p>Retest after a service changes how it reports a problem.<\/p>\n<p>Log a request identifier when it is appropriate and available. It can help authorized support staff investigate without repeating the service\u2019s raw detail to readers.<\/p>\n<p><!-- drai-run:dc05f788a5ae8f9cbfe7 --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A well-formed problem response still means the intended content did not arrive.<\/p>\n","protected":false},"author":5,"featured_media":3343,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/posts\/3342"}],"collection":[{"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/comments?post=3342"}],"version-history":[{"count":1,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/posts\/3342\/revisions"}],"predecessor-version":[{"id":3344,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/posts\/3342\/revisions\/3344"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/media\/3343"}],"wp:attachment":[{"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/media?parent=3342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/categories?post=3342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/danieldreitberg.com\/index.php\/wp-json\/wp\/v2\/tags?post=3342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}