Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(orchestrator): add OpenAPI support (#1123)
* Add generate-model to common Signed-off-by: Gloria Ciavarrini <[email protected]> * Add openapi spec and /oveview definition Signed-off-by: Gloria Ciavarrini <[email protected]> * Add generated models Signed-off-by: Gloria Ciavarrini <[email protected]> * Export generated types Signed-off-by: Gloria Ciavarrini <[email protected]> * Create openAPIBackend Signed-off-by: Gloria Ciavarrini <[email protected]> * Let OpenaAPIBackend handle requests Signed-off-by: Gloria Ciavarrini <[email protected]> * Comment api validation code block Due to the simultaneous use of both v1 and v2, validation is temporarily disabled. Enabling it results in an "operation unknown" error. This change ensures smooth operation until v1 is no longer needed. Signed-off-by: Gloria Ciavarrini <[email protected]> * Move generated models to auto-generated dir Signed-off-by: Gloria Ciavarrini <[email protected]> * Fix openapi.yaml header Signed-off-by: Gloria Ciavarrini <[email protected]> * Fix: change folder for exported types Signed-off-by: Gloria Ciavarrini <[email protected]> * Fix tsc Signed-off-by: Gloria Ciavarrini <[email protected]> * Add generated schema into dist-type dir tsc doens't copy d.ts files. Rename the generated schema to .ts and move it inside src Signed-off-by: Gloria Ciavarrini <[email protected]> * Script to include openapi spec at build-time. The sh script derives from notification-plugin[1] [1] https://github.com/janus-idp/backstage-plugins/blob/main/plugins/notifications-backend/scripts/openapi.sh Signed-off-by: Gloria Ciavarrini <[email protected]> * Add openapi script in common package.json Signed-off-by: Gloria Ciavarrini <[email protected]> * Update backend dist-dynamic Signed-off-by: Gloria Ciavarrini <[email protected]> * Generate openapidocument.ts Using `yarn openapi` command Signed-off-by: Gloria Ciavarrini <[email protected]> * Export openapidocument.ts Signed-off-by: Gloria Ciavarrini <[email protected]> * Implementation of workflow overview endpoints in handlers.ts Signed-off-by: Gloria Ciavarrini <[email protected]> * Use openapidocument instead of relative path Signed-off-by: Gloria Ciavarrini <[email protected]> * Implement v2 getWorkflowsOverview Signed-off-by: Gloria Ciavarrini <[email protected]> * Fix: Functions should not have too many parameters According to SonarCloud "Function 'setupInternalRoutes' has too many parameters (8). Maximum allowed is 7" Signed-off-by: Gloria Ciavarrini <[email protected]> * Reorganize openapi files - Rename openapidocument.ts to definition.ts - Move it into autogenerated folder - Moved openapi.yaml into src to create a valid dist-type Signed-off-by: Gloria Ciavarrini <[email protected]> * Split handlers into v1 and v2 Organize endpoint implementations based on the API versions for improved maintainability and clarity Signed-off-by: Gloria Ciavarrini <[email protected]> * Refactor initialization of OpenAPIBackend Signed-off-by: Gloria Ciavarrini <[email protected]> * Remove handler definiion in OpenAPIBackend Signed-off-by: Gloria Ciavarrini <[email protected]> --------- Signed-off-by: Gloria Ciavarrini <[email protected]>
- Loading branch information