Feat/define api specification for skill put and patch#520
Open
HabtamuTesafaye wants to merge 3 commits into
Open
Feat/define api specification for skill put and patch#520HabtamuTesafaye wants to merge 3 commits into
HabtamuTesafaye wants to merge 3 commits into
Conversation
HabtamuTesafaye
requested review from
C5rogers,
Copilot,
irumvanselme and
rav3n11
July 20, 2026 12:39
There was a problem hiding this comment.
Pull request overview
This PR adds full (PUT) and partial (PATCH) update capabilities for skills, spanning API specification updates (schemas, OpenAPI generation) and backend implementation (routing, controllers, service/repository methods), plus accompanying unit/integration tests.
Changes:
- Added Skill PUT/PATCH API-spec schemas/types/constants/enums and wired them into OpenAPI generation.
- Implemented backend PUT/PATCH handlers for
/models/{modelId}/skills/{id}, including routing + AJV validation schema registration. - Extended skill service/repository with
update+patch, and updated/added tests across layers.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/src/validator.ts | Registers AJV schemas for Skill PUT/PATCH request/response payloads. |
| backend/src/import/async/parseFiles.test.ts | Updates skill repository mock to include update/patch. |
| backend/src/export/esco/skill/SkillsToCSVTransform.test.ts | Updates skill repository mock to include update/patch. |
| backend/src/esco/skillGroup/index.test.ts | Adds routing tests for POST skillGroup parents. |
| backend/src/esco/skill/services/skill.service.types.ts | Extends skill service contract with update/patch and related types. |
| backend/src/esco/skill/services/skill.service.ts | Implements update/patch with model validation prior to repository write. |
| backend/src/esco/skill/services/skill.service.test.ts | Adds unit tests for service update/patch and extra history edge-case coverage. |
| backend/src/esco/skill/repository/skill.repository.ts | Adds repository update/patch methods using mongoose doc updates + populate. |
| backend/src/esco/skill/repository/skill.repository.test.ts | Adds in-memory MongoDB tests for repository update/patch. |
| backend/src/esco/skill/index.ts | Routes PUT/PATCH /skills/{id} to new handlers. |
| backend/src/esco/skill/index.test.ts | Adds router tests for PUT/PATCH dispatch. |
| backend/src/esco/skill/[id]/PUT/response.ts | Builds PUT response via existing skill transform. |
| backend/src/esco/skill/[id]/PUT/request.ts | Adds PUT request parsing, length check, and AJV validation. |
| backend/src/esco/skill/[id]/PUT/index.ts | Implements PUT controller (authz, param extraction, service call, error mapping). |
| backend/src/esco/skill/[id]/PUT/index.test.ts | Adds unit tests for Skill PUT handler behaviors and error cases. |
| backend/src/esco/skill/[id]/PUT/index.integration.test.ts | Adds DB-backed integration test validating PUT response schema. |
| backend/src/esco/skill/[id]/PATCH/response.ts | Builds PATCH response via existing skill transform. |
| backend/src/esco/skill/[id]/PATCH/request.ts | Adds PATCH request parsing, length check, and AJV validation. |
| backend/src/esco/skill/[id]/PATCH/index.ts | Implements PATCH controller (authz, param extraction, service call, error mapping). |
| backend/src/esco/skill/[id]/PATCH/index.test.ts | Adds unit tests for Skill PATCH handler behaviors and error cases. |
| backend/src/esco/skill/[id]/PATCH/index.integration.test.ts | Adds DB-backed integration test validating PATCH response schema. |
| backend/src/esco/skill/_shared/skill.types.ts | Introduces IUpdateSkillSpec and IPartialUpdateSkillSpec types. |
| backend/src/esco/occupations/services/occupation.service.test.ts | Updates mocks to include history-related repository/model methods used by occupation history. |
| backend/src/embeddings/asyncPublishEmbeddingsTask/index.integration.test.ts | Adjusts a test timeout (30s) to reduce flakiness. |
| backend/openapi/generateOpenApiDoc.ts | Includes Skill PUT/PATCH schemas and error schemas in generated OpenAPI. |
| api-specifications/src/esco/skill/index.test.ts | Asserts PUT/PATCH schemas are exported by the skill module. |
| api-specifications/src/esco/skill/[id]/PUT/schema.response.ts | Defines Skill PUT response schema. |
| api-specifications/src/esco/skill/[id]/PUT/schema.response.test.ts | Tests Skill PUT response schema validity and additionalProperties behavior. |
| api-specifications/src/esco/skill/[id]/PUT/schema.request.ts | Defines Skill PUT request schema (required fields, additionalProperties false). |
| api-specifications/src/esco/skill/[id]/PUT/schema.request.test.ts | Tests Skill PUT request schema validation and field constraints. |
| api-specifications/src/esco/skill/[id]/PUT/index.ts | Exposes PUT operation namespace (schemas/types/errors/constants). |
| api-specifications/src/esco/skill/[id]/PUT/index.test.ts | Smoke tests PUT operation exports. |
| api-specifications/src/esco/skill/[id]/PUT/enums.ts | Defines PUT-specific error codes. |
| api-specifications/src/esco/skill/[id]/PUT/constants.ts | Adds PUT payload size constants. |
| api-specifications/src/esco/skill/[id]/PATCH/schema.response.ts | Defines Skill PATCH response schema. |
| api-specifications/src/esco/skill/[id]/PATCH/schema.response.test.ts | Tests Skill PATCH response schema validity and additionalProperties behavior. |
| api-specifications/src/esco/skill/[id]/PATCH/schema.request.ts | Defines Skill PATCH request schema (all fields optional, additionalProperties false). |
| api-specifications/src/esco/skill/[id]/PATCH/schema.request.test.ts | Tests Skill PATCH request schema validation and field constraints. |
| api-specifications/src/esco/skill/[id]/PATCH/index.ts | Exposes PATCH operation namespace (schemas/types/errors/constants). |
| api-specifications/src/esco/skill/[id]/PATCH/index.test.ts | Smoke tests PATCH operation exports. |
| api-specifications/src/esco/skill/[id]/PATCH/enums.ts | Defines PATCH-specific error codes. |
| api-specifications/src/esco/skill/[id]/PATCH/constants.ts | Adds PATCH payload size constants. |
| api-specifications/src/esco/skill/[id]/index.ts | Wires PUT/PATCH operation exports into the skill detail module. |
| api-specifications/src/esco/skill/_shared/types.ts | Adds/extends type namespaces for skill PUT/PATCH operations. |
| api-specifications/src/esco/skill/snapshots/index.test.ts.snap | Updates snapshots to include newly exported PUT/PATCH namespaces. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…sing AJV schemas in skill request validation, while adding nullish fallbacks to occupation history service.
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.
This pull request contains changes for :