From 690f946bdc1978b35f02251249c1947ac7ec6e65 Mon Sep 17 00:00:00 2001 From: Deniss <30836373+TiPSYDiPSY@users.noreply.github.com> Date: Wed, 15 May 2024 13:50:32 +0300 Subject: [PATCH] Allow any value type in InstanceMetadata maps (#310) --- domain/apiresponses/responses_test.go | 12 ++++++------ domain/service_broker.go | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/domain/apiresponses/responses_test.go b/domain/apiresponses/responses_test.go index 96e37aef..6706107b 100644 --- a/domain/apiresponses/responses_test.go +++ b/domain/apiresponses/responses_test.go @@ -48,8 +48,8 @@ var _ = Describe("Provisioning Response", func() { It("returns it in the JSON", func() { provisioningResponse := apiresponses.ProvisioningResponse{ Metadata: domain.InstanceMetadata{ - Labels: map[string]string{"key1": "value1"}, - Attributes: map[string]string{"key1": "value1"}, + Labels: map[string]any{"key1": "value1"}, + Attributes: map[string]any{"key1": "value1"}, }, } jsonString := `{"metadata":{"labels":{"key1":"value1"}, "attributes":{"key1":"value1"}}}` @@ -82,8 +82,8 @@ var _ = Describe("Fetching Response", func() { ServiceID: "sID", PlanID: "pID", Metadata: domain.InstanceMetadata{ - Labels: map[string]string{"key1": "value1"}, - Attributes: map[string]string{"key1": "value1"}, + Labels: map[string]any{"key1": "value1"}, + Attributes: map[string]any{"key1": "value1"}, }, } jsonString := `{"service_id":"sID", "plan_id":"pID", "metadata":{"labels":{"key1":"value1"}, "attributes":{"key1":"value1"}}}` @@ -120,8 +120,8 @@ var _ = Describe("Update Response", func() { It("returns it in the JSON", func() { updateResponse := apiresponses.UpdateResponse{ Metadata: domain.InstanceMetadata{ - Labels: map[string]string{"key1": "value1"}, - Attributes: map[string]string{"key1": "value1"}, + Labels: map[string]any{"key1": "value1"}, + Attributes: map[string]any{"key1": "value1"}, }, } jsonString := `{"metadata":{"labels":{"key1":"value1"}, "attributes":{"key1":"value1"}}}` diff --git a/domain/service_broker.go b/domain/service_broker.go index 2c1af76a..b19dde2f 100644 --- a/domain/service_broker.go +++ b/domain/service_broker.go @@ -99,8 +99,8 @@ type ProvisionedServiceSpec struct { } type InstanceMetadata struct { - Labels map[string]string `json:"labels,omitempty"` - Attributes map[string]string `json:"attributes,omitempty"` + Labels map[string]any `json:"labels,omitempty"` + Attributes map[string]any `json:"attributes,omitempty"` } type DeprovisionDetails struct {