cloudfoundry-community/spring-boot-cf-service-broker

syslog drain url must not be present if it's value is `null` or it'll stop the client from registering a service broker

Closed this issue · 0 comments

I run into the following error when i specify null for a syslog drain url for the service instance binding response. i modified the spring-boot-cf-service-broker code and commented out the offending accessor method (below) and thinks seem to work now. Can we make sure that this property is either present (given a value) or not present at all absent a value?

status code: 502, error code: 10001, message: The service is attempting to stream logs from your application, but is not registered as a logging service. Please contact the service provider.

package org.cloudfoundry.community.servicebroker.model;

import java.util.Map;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.validator.constraints.NotEmpty;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * The response sent to the cloud controller when a bind
 * request is successful.
 * 
 * @author sgreenberg@gopivotal.com
 */
@JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)
@JsonIgnoreProperties(ignoreUnknown = true)
public class ServiceInstanceBindingResponse {

   ServiceInstanceBinding binding;

   public ServiceInstanceBindingResponse() {}

   public ServiceInstanceBindingResponse(ServiceInstanceBinding binding) {
      this.binding = binding;
   }

   @NotEmpty
   @JsonSerialize
   @JsonProperty("credentials")
   public Map<String, Object> getCredentials() {
      return binding.getCredentials();
   }
/*
   @JsonSerialize
   @JsonProperty("syslog_drain_url")
   public String getSyslogDrainUrl() {
      return binding.getSyslogDrainUrl();
   }
   */
}