Skip to content

Commit 29daf8e

Browse files
author
Jim Minter
committed
correct serialisation of tsb json schemas
1 parent 9446c1b commit 29daf8e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pkg/openservicebroker/api/types.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package api
22

33
// from https://github.com/openservicebrokerapi/servicebroker/blob/1d301105c66187b5aa2e061a1264ecf3cbc3d2a0/_spec.md
4-
// and https://github.com/avade/servicebroker/blob/9ef94ce96ca65bfc9ce482d5ea5be0ad62643a84/_spec.md
4+
// and https://github.com/avade/servicebroker/blob/8c340c610c6085c1aa32144faef0d1600c21576c/_spec.md
55

66
import (
77
jsschema "github.com/lestrrat/go-jsschema"
@@ -42,8 +42,8 @@ type Plan struct {
4242
}
4343

4444
type Schema struct {
45-
ServiceInstances ServiceInstances `json:"service-instances,omitempty"`
46-
ServiceBindings ServiceBindings `json:"service-bindings,omitempty"`
45+
ServiceInstance ServiceInstances `json:"service_instance,omitempty"`
46+
ServiceBinding ServiceBindings `json:"service_binding,omitempty"`
4747
}
4848

4949
type ServiceInstances struct {

pkg/template/servicebroker/catalog.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func serviceFromTemplate(template *templateapi.Template) *api.Service {
7777
Free: true,
7878
Bindable: true,
7979
Schemas: api.Schema{
80-
ServiceInstances: api.ServiceInstances{
80+
ServiceInstance: api.ServiceInstances{
8181
Create: map[string]*jsschema.Schema{
8282
"parameters": {
8383
SchemaRef: jsschema.SchemaURL,
@@ -87,7 +87,7 @@ func serviceFromTemplate(template *templateapi.Template) *api.Service {
8787
},
8888
},
8989
},
90-
ServiceBindings: api.ServiceBindings{
90+
ServiceBinding: api.ServiceBindings{
9191
Create: map[string]*jsschema.Schema{
9292
"parameters": {
9393
SchemaRef: jsschema.SchemaURL,

pkg/template/servicebroker/catalog_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func TestServiceFromTemplate(t *testing.T) {
6161
Free: true,
6262
Bindable: true,
6363
Schemas: api.Schema{
64-
ServiceInstances: api.ServiceInstances{
64+
ServiceInstance: api.ServiceInstances{
6565
Create: map[string]*schema.Schema{
6666
"parameters": {
6767
Type: schema.PrimitiveTypes{schema.ObjectType},
@@ -94,7 +94,7 @@ func TestServiceFromTemplate(t *testing.T) {
9494
},
9595
},
9696
},
97-
ServiceBindings: api.ServiceBindings{
97+
ServiceBinding: api.ServiceBindings{
9898
Create: map[string]*schema.Schema{
9999
"parameters": {
100100
Type: schema.PrimitiveTypes{schema.ObjectType},

0 commit comments

Comments
 (0)