spring-cloud-open-service-broker icon indicating copy to clipboard operation
spring-cloud-open-service-broker copied to clipboard

Possibility to extend broker responses

Open indvd00m opened this issue 2 years ago • 1 comments

In some cases we need to extend OSB specification and add extra fields to responses from service broker. For example it is not possible right now write something like this:

public class MyCreateServiceInstanceResponse extends CreateServiceInstanceResponse {

    private final String myCustomField2;

    ...
}

and after that use this reponse in ServiceInstanceService:

public class MyServiceInstanceService implements ServiceInstanceService {
...
    @Override
    public Mono<MyCreateServiceInstanceResponse> createServiceInstance(CreateServiceInstanceRequest request) {
...
}

Java compiler throw exception like this in that case:

java: my.package.MyServiceInstanceService is not abstract and does not override abstract method createServiceInstance(org.springframework.cloud.servicebroker.model.instance.CreateServiceInstanceRequest) in org.springframework.cloud.servicebroker.service.ServiceInstanceService

This changes are intended to allow this to be done.

indvd00m avatar Nov 25 '22 15:11 indvd00m

I started reviewing this, and at first glance, it will cause some challenges with regard to generic types in method parameters and return types. I'll see where I can get with it, but my preference is to avoid significantly disrupting the API.

royclarkson avatar Feb 15 '23 18:02 royclarkson