feat: Added contract for the proposed generic endpoint#122
feat: Added contract for the proposed generic endpoint#122NethmikaKekuu wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new endpoint /v1/entities-by-relation/{parent_id} to retrieve related entities in the organisation hierarchy. The feedback suggests changing the tag spelling from Organization to Organisation to match the rest of the project and avoid duplicate tags in generated documentation. Additionally, it is recommended to explicitly mark the top-level response fields (total, new, entityList) and item-level fields (isNew, hasData) as required in the schema to ensure consistent client model generation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| - name: relation | ||
| in: query | ||
| required: true | ||
| description: Relation to traverse. | ||
| schema: | ||
| type: string | ||
| enum: | ||
| - AS_DEPARTMENT | ||
| - AS_BODY |
There was a problem hiding this comment.
We can move this filters to the request body. and it should support for relation lists
There was a problem hiding this comment.
Will move it to the request body after other comments are received
7f0f9e8 to
c142800
Compare
Summary
POST /v1/entities-by-relation/{parent_id}?relation=..., to replace having one endpoint per hierarchy level. It covers both existingdepartments-by-portfolio-style traversal and the newly needed department→body traversal, and any future level, without adding a new endpoint each time.relationis a query param constrained by an OpenAPI enum toAS_DEPARTMENT/AS_BODY— a deliberate whitelist so the endpoint can't be used to traverse unrelated relation types (e.g.AS_APPOINTED,AS_PRESIDENT).departments-by-portfoliofields (totalDepartments/newDepartments/departmentList) into relation-agnostictotal/new/entityList, so the same shape works for departments, bodies, or any future level.Test plan
organisation_api_contract.yamlvalidated to parse as valid OpenAPI YAML