Correct response annotations that mis-describe actual API responses - #1234
Merged
Conversation
HandleDelete -> ConvertDeleteToHttp returns NoContent() = 204 (HydraController.cs:174); the 202 annotation was a lie. No behaviour change. Hygiene-sprint mechanical track (cards SPA-08, XC-01). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DeleteSpace uses HandleDelete -> NoContent() = 204 with an empty body; the annotation promised a Space body that never arrives. No behaviour change. Hygiene-sprint mechanical track (cards SPA-09, XC-01). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
All 13 ProblemDetails ProducesResponseType annotations (PUT, PATCH and legacy POST) now declare typeof(Error), matching the actual HydraProblem bodies and every other controller. These were the only ProblemDetails annotations in API. No behaviour change. Hygiene-sprint mechanical track (card XC-05). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PUT /adjuncts/{id} is an upsert returning 201 for a new adjunct, and
deliberately returns a single Adjunct (adjuncts.Single().ToHydra), never
a collection. Was annotated 200-only with HydraCollection<Adjunct>. No
behaviour change. Hygiene-sprint mechanical track (card XC-11).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The no-adjuncts-found path returns HydraProblem(..., 400, ...) (CustomerAdjunctsController.cs:65), not 404. No behaviour change. Hygiene-sprint mechanical track. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
donaldgray
marked this pull request as ready for review
August 5, 2026 09:35
donaldgray
approved these changes
Aug 5, 2026
tomcrane
added a commit
that referenced
this pull request
Aug 5, 2026
Session-0 ratification (2026-08-06), extending the rule PR #1234 started: every 4xx/5xx ProducesResponseType annotation declares Type = typeof(Error), matching the HydraProblem bodies. 24 bare error-status annotations across 9 controllers gain the type; three controllers gain the Hydra.Model using. Annotations only - no wire change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Corrects
[ProducesResponseType]annotations that disagree with what the endpoints actually return. No behaviour change — no runtime code paths are touched; only the generated Swagger/OpenAPI documentation is affected. One commit per fix.DeliveryChannelPoliciesController.DeleteDeliveryChannelPolicywas annotated202 Accepted, but it usesHandleDelete, which returns204 No Contenton success.SpaceController.DeleteSpacewas annotated200 OKwith aSpacebody; it also usesHandleDeleteand actually returns204 No Contentwith an empty body.ImageControllerannotated its error responses (on PUT, PATCH and the legacy POST — 13 annotations in total) asProblemDetails, but the endpoints produce HydraErrorbodies viaHydraProblem, like every other controller. These were the onlyProblemDetailsannotations in the API project; the OpenAPI contract was advertising the wrong error schema for the asset endpoints.AdjunctsController.PutAdjunctwas annotated200-only returningHydraCollection<Adjunct>. It is an upsert — it returns201 Createdwhen the adjunct is new — and it deliberately returns a singleAdjunct(adjuncts.Single().ToHydra(...)), never a collection. Now annotated200+201, typeAdjunct.CustomerAdjunctsController.DeleteAdjunctswas annotated404for its failure case, but the no-matching-adjuncts path returns a400(HydraProblem("No adjuncts found", null, 400, ...)).Builds clean against
develop(0 errors).🤖 Generated with Claude Code