Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current broker.CatralogResponse object does not unmarshal #34

Open
n3wscott opened this issue Mar 24, 2018 · 2 comments
Open

Current broker.CatralogResponse object does not unmarshal #34

n3wscott opened this issue Mar 24, 2018 · 2 comments

Comments

@n3wscott
Copy link
Contributor

n3wscott commented Mar 24, 2018

With the following code from the stater pack:

	response := &osb.CatalogResponse{}

or

	response := &broker.CatalogResponse{}

and

	data := `
---
services:
- name: example-starter-pack-service
  id: 4f6e6cf6-ffdd-425f-a2c7-3c9258ad246a
  description: The example service from the osb starter pack!
`
	err := yaml.Unmarshal([]byte(data), &response)

Results:

Broker: &{CatalogResponse:{Services:[]}}
OSB: &{Services:[{ID:4f6e6cf6-ffdd-425f-a2c7-3c9258ad246a Name:example-starter-pack-service Description:The example service from the osb starter pack! Tags:[] Requires:[] Bindable:false BindingsRetrievable:false PlanUpdatable:<nil> Plans:[] DashboardClient:<nil> Metadata:map[]}]}

It seems that this does not work as intended:

type CatalogResponse struct {
	osb.CatalogResponse
}

This works:

type CatalogResponse osb.CatalogResponse

But not what was intended by the change I think

@n3wscott
Copy link
Contributor Author

interesting update, using the current osb broker lib:

type CatalogResponse struct {
	osb.CatalogResponse
}

and the same data, this worked:

err := yaml.Unmarshal([]byte(data), &response.CatalogResponse)

@pmorie
Copy link
Owner

pmorie commented Mar 24, 2018 via email

jboyd01 pushed a commit to jboyd01/osb-broker-lib that referenced this issue Apr 17, 2018
Add provision and bind targets to Makefile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants