Repository navigation
Fixes 36413: Return 400 for malformed entity names (backport 2.1 #36414) - #36415
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
| ApiAssertions.assertBadRequest( | ||
| () -> getEntityByName("\""), | ||
| "Getting " + getEntityType() + " by a malformed name should be a bad request"); |
There was a problem hiding this comment.
Error message remains untested
The new API test checks only HTTP 400. The second argument to assertBadRequest is an assertion label, not the expected response message. Capture the returned exception and check that the response includes Invalid fully qualified name and the malformed input. Otherwise, the test still passes if the API returns an empty or generic message, leaving the clear-message part of this fix untested.
Code Review ✅ Approved🟡 Medium risk · Mapping malformed FQN parse failures to HTTP 400 across name-based endpoints could disrupt clients that expect the former server-error response. Backport of the malformed entity name fix: the FQN parser now throws VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Issue
Cherry-pick of PR #36414 (Fixes #36413)
What it does
A malformed entity name in a request, for example
GET /api/v1/tables/name/", made the API return HTTP 500 with no message. The name parser's error was never translated, so the server reported it as an unhandled exception.The parser now reports a malformed name as
IllegalArgumentException("Invalid fully qualified name <input>"). The server already maps that exception to 400, so every endpoint that takes a name now answers 400 with a clear message. Valid names behave as before. The full explanation is in the main PR.How it was tested on 2.1
git patch-id --stable).utilpackage pass, including the updatedFullyQualifiedNameTest.BaseEntityIT.get_entityByMalformedName_400passed for all 63 entity types on MySQL + Elasticsearch.

Confidence Score: 5/5
The PR appears safe to merge, with one non-blocking test gap from the previous review.Findings
Summary
The PR turns malformed entity names into HTTP 400 errors with a clear message.
Reviews (2) · Last reviewed commit: "Mark new FQN parse locals final" · Reviewed by Greptile