manifest
manifest copied to clipboard
Fixed Duplicate code for issue #170
Issue Number
#170
Description
This PR refactors the code by eliminating the duplication of the 403 Forbidden response in the OpenAPI manifest generation. A reusable utility function getForbiddenResponse has been created and moved to a separate file (common-response.utils.ts). This function is now used across multiple files where the 403 Forbidden response is required, ensuring DRY principles and improving maintainability.
Related Issues
N/A
How can it be tested?
- You can just run the existing unit and integration tests to ensure no breaking changes.
- Test the API endpoints that require a 403 Forbidden response to confirm that the response format remains consistent after refactoring.
- Optionally, manually invoke any API endpoints related to manifest or entity manifest to make sure it's proper.
Checklist before submitting
- [x] I have performed a self-review of my code (no debugs, no commented code, good naming, etc.)
- [x] This PR is wrote in a clear language and correctly labeled