spring-cloud / spring-cloud-open-service-broker

Spring Cloud project for creating service brokers that conform to the Open Server Broker API specification
https://spring.io/projects/spring-cloud-open-service-broker
Apache License 2.0
167 stars 118 forks source link

Remove dashboard_url from CreateServiceResponse if null or empty #109

Closed kayuweschmidt closed 6 years ago

kayuweschmidt commented 6 years ago

According to the open service broker api specification the CreateServiceResponse [1] should not contain the dashboard_url if it is null or empty [2]. Recently, the cloud foundry cloud controller was updated [3] which led to an incompatible change. The cf create-service command fails if the service broker returns a dashboard_url that is null or empty with an error message like:

"The property '#/dashboard_url' of type null did not match the following type: string".

[1] https://github.com/spring-cloud/spring-cloud-open-service-broker/blob/86f947fe3c5ae124c6ac51e6a3371594a749ea63/spring-cloud-open-service-broker-core/src/main/java/org/springframework/cloud/servicebroker/model/instance/CreateServiceInstanceResponse.java#L38 [2] https://github.com/openservicebrokerapi/servicebroker/blob/v2.13/spec.md#body-3 [3] https://github.com/cloudfoundry-incubator/cloud_controller_ng_sapi/commit/81016c6bb9b954c5b16bb4eed6e4a66ee47a3560

royclarkson commented 6 years ago

Thanks for reporting!

Samze commented 6 years ago

Thanks! We are also fixing this in CloudController. More details here: https://www.pivotaltracker.com/story/show/159172375

Albertoimpl commented 6 years ago

To clarify: We are handling the null case correctly. When the response is null the payload response is {} when the response is created with something like CreateServiceInstanceResponse.builder().build();.

However, what wasn't correct was the empty case "". I just created #112 to fix that problem and verify that we are behaving correctly.