The examples below show how allowing multiple patterns per resource could simplify both service contributor development and significantly reduce the size of a generated gateway.xml.

ResourceDescriptor fileResource = context.getGatewayDescriptor().addResource();
fileResource.role( service.getRole() );
fileResource.pattern( WEBHDFS_EXTERNAL_PATH + "/?**" );
fileResource.pattern( WEBHDFS_EXTERNAL_PATH + "/**?**" );
<gateway>
  <resource>
    <role>WEBHDFS</role>
    <pattern>/webhdfs/v1/?**</pattern>
    <pattern>/webhdfs/v1/**?**</pattern>
    <filter>
      ...
    </filter>
    ...
  </resource>
</gateway>