Skip to content

Fix copy-paste errors and stale metadata in Hydra models - #1235

Merged
donaldgray merged 6 commits into
developfrom
hygiene/mechanical-c2
Aug 5, 2026
Merged

Fix copy-paste errors and stale metadata in Hydra models#1235
donaldgray merged 6 commits into
developfrom
hygiene/mechanical-c2

Conversation

@tomcrane

@tomcrane tomcrane commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Small copy-paste and metadata fixes in the Hydra model layer and the custom-header feature. None of these change consumer-facing runtime JSON values — they affect generated vocab/Hydra documentation, one validation error message, and property emission order only. One commit per fix.

  • CustomHeader.Role was declared ReadOnly = true in its [HydraLink] attribute, but role is freely settable on POST and PUT (the converter copies it and UpdateCustomHeader writes it). Now ReadOnly = false to match behaviour.
  • Custom-header validator/converter said "named query" — the "@id must not be supplied" rule reported "DLCS must allocate named query id..." on a custom header request, and the converter's parameter was named hydraNamedQuery. Both are copy-paste remnants from the NamedQuery feature; message and parameter renamed.
  • Tied JsonProperty Orders made emission order undefined for several properties: ImageStorage had adjunctSize/lastChecked/checkingInProgress all at Order 55 (now 55/56/57); ApiKey had key/secret both at 12 (now 12/13); PortalUser had created/roles both at 13 (now 13/14, with enabled bumped 14→15 to preserve the sequence).
  • QueueSummary vocab wiring was a copy-paste bug: the class was annotated [HydraClass(typeof(QueueClass), ...)] — pointing at the customer Queue's Hydra class rather than its own — and QueueSummaryClass bootstrapped over typeof(QueueSummaryClass) (itself) instead of typeof(QueueSummary). Both now follow the pattern used by Batch/BatchClass and Queue/QueueClass. Runtime JSON (the counts) is unaffected; the generated vocab/ApiDocumentation for QueueSummary was wrong.
  • NamedQuery carried stale metadata: the class was still annotated [Unstable(Note = "Currently the named query implementation is a placeholder,")] although the named-query management API (GET/PUT/DELETE/POST) and all output projections are fully implemented; and DefineOperations advertised a PATCH operation the controller does not implement. Annotation removed, PATCH dropped from the advertised operations.

Noticed while in NamedQuery.cs but deliberately not changed here: global and template share JsonProperty Order 11 — the same defect class as the renumbering above, left for a follow-up.

Builds clean against develop (0 errors).

🤖 Generated with Claude Code

tomcrane and others added 6 commits August 5, 2026 10:18
role is freely settable on POST and PUT (CustomHeaderConverter copies
it; UpdateCustomHeader writes it) and the docs table says readonly
False. Only generated vocab/Hydra docs change. Hygiene-sprint
mechanical track (card ACC-04).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The @id-must-be-empty rule reported a named query error on custom
header requests; the converter parameter was likewise misnamed
hydraNamedQuery. Hygiene-sprint mechanical track (card ACC-05).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Ties made property emission order undefined:
- ImageStorage: adjunctSize/lastChecked/checkingInProgress all 55 ->
  55/56/57
- ApiKey: key/secret both 12 -> 12/13
- PortalUser: created/roles both 13 -> 13/14 (enabled 14 -> 15 to keep
  the sequence)

Serialisation ordering only; no schema or value change. Hygiene-sprint
mechanical track (card ACC-07).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ApiKey.cs key-create operation label ended mid-sentence with a typo
(Requires eleveated); Customer.cs keys link said the generates secret.
Generated vocab/documentation strings only. Hygiene-sprint mechanical
track (card ACC-19; the docs half is public-docs batch D2).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
QueueSummary was annotated with the customer Queue class
(HydraClass(typeof(QueueClass))) and QueueSummaryClass bootstrapped
over itself instead of typeof(QueueSummary) - compare BatchClass ->
typeof(Batch), QueueClass -> typeof(Queue). Runtime JSON unaffected;
generated vocab/ApiDocumentation for QueueSummary was wrong.
Hygiene-sprint mechanical track (card PRO-10).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The named-query management API (GET/PUT/DELETE/POST) and all output
projections are fully implemented; the placeholder Unstable annotation
was misleading. DefineOperations advertised a PATCH the controller does
not implement (the docs table correctly omits it). Hygiene-sprint
mechanical track (card DIS-13).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tomcrane tomcrane changed the title Hygiene mechanical Batch C2: cosmetic model/validator fixes Fix copy-paste errors and stale metadata in Hydra models Aug 5, 2026
@donaldgray
donaldgray marked this pull request as ready for review August 5, 2026 09:35
@donaldgray
donaldgray requested a review from a team as a code owner August 5, 2026 09:35
@donaldgray
donaldgray merged commit 5c13a2f into develop Aug 5, 2026
2 checks passed
@donaldgray
donaldgray deleted the hygiene/mechanical-c2 branch August 5, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants