Repository navigation
fix(api): return 400 for invalid graph traversal modes - #169
Merged
foukou19 merged 1 commit intoOct 22, 2026
Merged
Conversation
hamdirahalpartner-del
requested review from
brandPittCode
and
a balanced review from Copilot
October 16, 2026 07:09
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The published static OpenAPI contract still needs regeneration to include the new 400 response.
1 open finding
What changed in this PR
Improves API error handling so invalid graph parameters return descriptive 400 responses instead of 500 errors.
Changes:
- Adds type-mismatch handling with allowed enum values.
- Documents the graph endpoint’s 400 response.
- Adds regression tests for invalid, supported, and default parameters.
| File | Description |
|---|---|
| src/test/java/com/decathlon/idp_core/infrastructure/adapters/api/handler/ApiExceptionHandlerTest.java | Tests parameter conversion and error responses. |
| src/main/java/com/decathlon/idp_core/infrastructure/adapters/api/handler/ApiExceptionHandler.java | Handles parameter type mismatches as 400 errors. |
| src/main/java/com/decathlon/idp_core/infrastructure/adapters/api/controller/EntityGraphController.java | Declares the graph endpoint’s 400 response. |
| src/main/java/com/decathlon/idp_core/infrastructure/adapters/api/configuration/SwaggerDescription.java | Adds the invalid-query response description. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code coverage overviewLanguages: Java Java / code-coverage/jacoco
View coverage of the 3 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
foukou19
previously approved these changes
Oct 21, 2026
foukou19
enabled auto-merge (squash)
October 21, 2026 13:01
hamdirahalpartner-del
force-pushed
the
CPDE-3321-idp-core-error-response-when-uknow-graph-mode
branch
2 times, most recently
from
October 21, 2026 14:55
0e419c7 to
d605169
Compare
Signed-off-by: hamdirahalpartner-del <hamdi.rahal.partner@decathlon.com>
hamdirahalpartner-del
force-pushed
the
CPDE-3321-idp-core-error-response-when-uknow-graph-mode
branch
from
October 22, 2026 07:06
8fdc65f to
c2cd89f
Compare
|
evebrnd
approved these changes
Oct 22, 2026
foukou19
deleted the
CPDE-3321-idp-core-error-response-when-uknow-graph-mode
branch
October 22, 2026 09:00
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.




Handle request parameter type mismatches with descriptive error messages and list allowed enum values instead of returning 500.
Document the graph endpoint's 400 response and add regression tests.
PR Description
What this PR Provides
DIRECT_LINEAGEmode.Fixes
Review
The reviewer must double-check these points:
How to test
Initial state
Run the application and authenticate with an account authorized to access the graph endpoint.
Ensure an entity exists and use its template identifier and entity identifier in the requests below.
Invalid traversal mode
Call the endpoint with an unsupported traversal mode:
Expected result: HTTP 400 Bad Request with this response:
{ "error": "BAD_REQUEST", "error_description": "Invalid value 'OUTBOUND_ONL' for parameter 'traversal_mode'. Allowed values: [DIRECT_LINEAGE, BIDIRECTIONAL, OUTBOUND_ONLY]." }Supported traversal modes
Call the endpoint with each supported value:
DIRECT_LINEAGE,BIDIRECTIONAL, andOUTBOUND_ONLY.Expected result: HTTP 200 OK with the entity graph.
Call the endpoint without the
traversal_modeparameter.Expected result: HTTP 200 OK, using
DIRECT_LINEAGEas the default.Other invalid parameter types
Call the endpoint with
depth=abcorinclude_data=invalid.Expected result: HTTP 400 Bad Request with an error description identifying the invalid parameter, its value, and the expected type.
API documentation
Open the documentation site's Swagger UI and inspect the graph endpoint.
Expected result: the endpoint documents the 400 response with the
ErrorResponseschema.Breaking changes (if any)
Context of the Breaking Change
N/A.
Result of the Breaking Change
N/A.