Skip to content

Commit

Permalink
Allow any value type in InstanceMetadata maps (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
TiPSYDiPSY authored May 15, 2024
1 parent 2ee8bd8 commit 690f946
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions domain/apiresponses/responses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}}}`
Expand Down Expand Up @@ -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"}}}`
Expand Down Expand Up @@ -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"}}}`
Expand Down
4 changes: 2 additions & 2 deletions domain/service_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 690f946

Please sign in to comment.