fix(openapi): declare the removed device count the namespace carries - #7130
Conversation
|
Claude finished @gustavosbarreto's task in 6m 28s —— View job Code Review CompleteReviewed 3 files. 1 inline issue posted. Standards: 0 violations, 1 judgement call. StandardsNo rule violations. The one judgement call is Duplicated Code: CorrectnessNo defects. The contract the schema now declares matches what the server sends: SpecThe Spec axis did not run. Neither the PR body nor commit To request another review round, comment |
|
/review |
|
Claude finished @gustavosbarreto's task in 5m 8s —— View job Code Review CompleteReviewed 3 files on all three axes: Standards (repo rules, language conventions, tests, code smells), Spec (does it implement the issue?) and Correctness (security and runtime defects). No new issues found. The code looks good as-is. The Spec axis did not run: neither the PR body nor commit The one Standards judgement call this round surfaced — the full What Correctness established this round, since the change makes a property
· |
c63f1ab to
15002c8
Compare
|
/review |
|
Claude finished @gustavosbarreto's task in 5m 11s —— View job Code Review CompleteReviewed 3 files. 1 inline issue posted. Standards: 0 violations, 1 judgement call. StandardsThe one judgement call is on the fixture collapse this round introduced: The alias-and-shadow ( CorrectnessNo defects. The factory's defaults match the deleted literal exactly for every field the conversion dropped — The suite could not be run here: SpecThe Spec axis did not run. Neither the PR body nor commit To request another review round, comment |
models.Namespace has serialized devices_removed_count since cb2cf42, when removed devices stopped weighing against the device limit, and the schema never gained the property. It sat alongside three siblings the schema does declare and require, so the omission reads as an oversight rather than a decision. Declared as required, matching the siblings: the field has no omitempty, so every namespace response carries it. That makes the generated TypeScript type require it too, which is why the namespace fixture now sets it. The admin drawer test kept a full Namespace literal beside the shared factory, which is what made this a two-place change. Collapsing it to a factory call with overrides puts the counters in one place, so the next one added to the schema does not reach into that file at all.
15002c8 to
6355ebd
Compare
|
/review |
|
Claude finished @gustavosbarreto's task in 5m 3s —— View job Code Review CompleteReviewed 3 files on all three axes: Standards (repo rules, language conventions, tests, code smells), Spec (does it implement the issue?) and Correctness (security and runtime defects). No new issues found. The code looks good as-is. The Spec axis did not run because there is no issue to review against: neither the PR body nor commit The only Standards candidate this round was the aliased import ( Both fixes from the previous rounds check out at What Correctness established, since the change makes a response property
The suite was not run here: · |
What
The namespace schema now declares
devices_removed_count, the fourth device counter theserver has been sending all along.
Why
models.Namespace.DevicesRemovedCounthas serialized since cb2cf42, when removeddevices stopped weighing against the device limit. The schema gained the other three
counters and not this one. Nothing failed over it, because the schema sets no
additionalProperties: falseand the validator only checks declared properties, so thefield travelled undeclared instead of loudly.
Split out of #7129, which found it while editing the same schema.
Changes
openapi/spec/components/schemas/namespace.yaml: the property, declared requiredto match its three siblings. The Go field has no
omitempty, so every namespaceresponse carries it.
ui/apps/console/src/tests/factories.tsand the admin drawer test: the generatedTypeScript type now requires the field, so the two namespace fixtures set it. This is
the whole cost of declaring it required, and it is why the change touches the console.
Testing
Worth confirming the generated client is what changed rather than any runtime behaviour.
npm run generateinside theuicontainer rewritessrc/client/types.gen.ts, wheredevices_removed_count: numberbecomes non-optional;npm run build -w @shellhub/consoletypechecks against it. No server code changes.