Repository navigation
Error: HTTP status in code, rule name in reason (#159) - #160
Merged
Merged
Conversation
…eason` (#159) The kit's Error had a string `code` naming the rule, an integer `status` and a uuid `id`. It never compiled with the C# domainExceptions artifact (22 CS0029 on generator 0.17.0). Adopt the shape RestoManager runs end to end: integer `code` (HTTP status), optional snake_case `reason` (the rule), plain-string `id`, no `status`. Add `type` and an `ErrorType` enum, which domainExceptions requires (ARTIFACT_SCHEMA_DEPENDENCY) and no handbook mentioned. - API_Handbook §11 rewritten, §2.1 and every example move rule names to `reason`; scaffold, hello-orders and endpoint-samples updated. - spec-drafting skill asserts errors[0].reason. - example-regen generates domainExceptions from a hello-orders copy and builds it (.github/ci/error-shape-probe), so the shape is compile-checked on every PR and pin bump. - compatibility.md §54 records the decision, the measurement and the migration; §51, §52 and §53 point to it. Closes #159. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #159. Generator side: clabonte/generator#2671 (body rewritten to match).
What changes
codereason^[a-z][a-z0-9_]*$, max 64, optional)statusidformat: uuidtype$ref: ErrorType(newx-extensibleenum, the 8 valuesdomainExceptionsrequires)API_Handbook.md§11 rewritten (schema, whatcode/type/reasonare each for, theErrorTyperequirement, how to setreasonfrom generated C# until #2671 ships, error table recast astype+ commonreasonvalues). §2.1 and every JSON/YAML example move rule names toreason.initscaffold,hello-orders,samples/endpoint-samples.yaml,spec-draftingskill.compatibility.md§54: decision, measurement, migration for projects on the old shape. §51 / §52 / §53 point to it.example-regen.ymlgeneratesdomainExceptionsfrom ahello-orderscopy anddotnet builds it via.github/ci/error-shape-probe/ErrorShapeProbe.csproj.Beyond #159
type+ErrorTypeadded. Measured on 0.17.0:domainExceptionsfailsgeneratewith twoARTIFACT_SCHEMA_DEPENDENCYERRORs unlessError.typeis typed by anErrorTypeenum with 8 specific values. No handbook said so. Without it the compile check in #159 can't exist.Measured (generator 0.17.0,
hello-orderscopy +domainExceptions)Error(+type): 22 distinctCS0029(oneId, oneCodeper exception-builtError).Error: 0 errors. CI step replayed locally: 0 errors.hello-ordersvalidate: 0 / 19 / 11, unchanged; its own group now generates 15 files (+ErrorType.g.cs). Kit Spectral: same 20 findings, 0 errors.initscaffold: validates, same five finding codes as §53.Breaking
For any project scaffolded by kit ≤ 0.26.0 that keeps the kit's
Error: wire change for clients branching oncode/ readingstatus. Migration in §54. Generated C# never compiled against the old shape, so no generated code depends on it.🤖 Generated with Claude Code