Skip to content

Add input validation for deploymentId and gatewayId in RestoreDeployment handler #1996

@coderabbitai

Description

@coderabbitai

Summary

The RestoreDeployment handler in platform-api/src/internal/handler/webbroker_api_deployment.go does not validate that deploymentId and gatewayId are non-empty before invoking the service layer. This can result in unclear errors reaching the client instead of an explicit 400 Bad Request response.

The UndeployDeployment handler in the same file already performs these checks and can serve as the reference implementation.

Expected Behavior

If deploymentId or gatewayId is empty, the handler should return HTTP 400 with a descriptive error message before calling RestoreWebBrokerAPIDeploymentByHandle.

References

Requested by @senthuran16

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions