Refuse a malformed catalogue entry on PUT /api/components/catalogue with 400 - #516
Merged
davidmckayv merged 2 commits intoSep 13, 2026
Conversation
Ayush7614
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
September 13, 2026 05:15
davidmckayv
approved these changes
Sep 13, 2026
davidmckayv
left a comment
Contributor
There was a problem hiding this comment.
Deep-reviewed clean (validation, no secret leak, fail-closed, agrees with existing layers). CI green.
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.
The route dropped entries failing the shape check and answered 200 with the rest, so a typo'd deploy got {added:[]} — the same body as already-in-sync — while publishing nothing. The operator found out from a missing component, not the API.
All-or-nothing now: the first malformed entry answers 400 naming its index (Component at index N needs a name, a title, a kind and a description.); [] still syncs to 200. Updates the old silent-drop test to the corrected 400.
Tests: updated component-catalogue.test.ts + new component-catalogue-entries.test.ts (empty list, atomicity, non-object entries, 6 malformed shapes, 3-entry happy path) — 19 pass.