Skip to content

Refuse a malformed catalogue entry on PUT /api/components/catalogue with 400 - #516

Merged
davidmckayv merged 2 commits into
CopilotKit:mainfrom
Ayush7614:fix/component-catalogue-entries-validation
Sep 13, 2026
Merged

Refuse a malformed catalogue entry on PUT /api/components/catalogue with 400#516
davidmckayv merged 2 commits into
CopilotKit:mainfrom
Ayush7614:fix/component-catalogue-entries-validation

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

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.

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep-reviewed clean (validation, no secret leak, fail-closed, agrees with existing layers). CI green.

@davidmckayv
davidmckayv merged commit 9d94f87 into CopilotKit:main Sep 13, 2026
15 checks passed
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