From c871d788b0f206f5f4a99e4d6ae348be714e2711 Mon Sep 17 00:00:00 2001 From: Alex Luong Date: Fri, 2 May 2025 14:16:23 +0700 Subject: [PATCH 1/2] chore: Make destination config optional --- internal/services/api/destination_handlers.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/services/api/destination_handlers.go b/internal/services/api/destination_handlers.go index 4dd2ee74..474ebda7 100644 --- a/internal/services/api/destination_handlers.go +++ b/internal/services/api/destination_handlers.go @@ -313,7 +313,7 @@ type CreateDestinationRequest struct { ID string `json:"id" binding:"-"` Type string `json:"type" binding:"required"` Topics models.Topics `json:"topics" binding:"required"` - Config models.Config `json:"config" binding:"required"` + Config models.Config `json:"config" binding:"-"` Credentials models.Credentials `json:"credentials" binding:"-"` } @@ -321,6 +321,9 @@ func (r *CreateDestinationRequest) ToDestination(tenantID string) models.Destina if r.ID == "" { r.ID = uuid.New().String() } + if r.Config == nil { + r.Config = make(map[string]string) + } if r.Credentials == nil { r.Credentials = make(map[string]string) } From 2972de14c4f7361d7960e5f20bac29d40b9fb202 Mon Sep 17 00:00:00 2001 From: Alex Luong Date: Fri, 2 May 2025 14:18:23 +0700 Subject: [PATCH 2/2] test: Update test --- cmd/e2e/api_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/e2e/api_test.go b/cmd/e2e/api_test.go index d9e2a58f..fefde5ec 100644 --- a/cmd/e2e/api_test.go +++ b/cmd/e2e/api_test.go @@ -344,7 +344,6 @@ func (suite *basicSuite) TestDestinationsAPI() { Body: map[string]interface{}{ "message": "validation error", "data": map[string]interface{}{ - "config": "required", "topics": "required", "type": "required", },