title: How to write complex predicate for discovery locator in Spring Cloud Gateway?
body: <p>I want to customize discovery locator behavior. On of my cases is, for example, routing from <code>gateway_host/prohibitions</code> to service named <code>prohibitions-ui</code>. For this purpose I'm using this config:</p>
  
  <pre><code>spring:
    cloud:
      gateway:
        discovery:
          locator:
            enabled: true
            lower-case-service-id: true
            filters: PreserveHostHeader
            include-expression: serviceId.endsWith('-UI')
            predicates: Path='/'+serviceId.substring(0,serviceId.indexOf('-UI'))+'/**'
  </code></pre>
  
  <p>Then error:</p>
  
  <pre><code>Failed to bind properties under 'spring.cloud.gateway.discovery.locator.predicates' to java.util.List&lt;org.springframework.cloud.gateway.handler.predicate.PredicateDefinition&gt;:
  
  Reason: failed to convert java.lang.String to org.springframework.cloud.gateway.handler.predicate.PredicateDefinition
  </code></pre>
  
  <p>I think this error rising because of two arguments passed to <code>substring</code> method. If I change method call to <code>substring(0)</code> then application starts successfully, but such config for me doesn't make sense:
  <code>predicates: Path='/'+serviceId.substring(0)+'/**'</code></p>