title: How to get Swagger to use @ApplicationPath?
body: <p>swagger-jaxrs 1.5.18</p>
  
  <p>I have an Application at @ApplicationPath("/docs"), and under it a resource at @Path("/mydocs"). The real endpoint is thus /api/docs/mydocs, but what is generated in swagger.json is /api/mydocs.</p>
  
  <p>Desired swagger url: /api/docs/mydocs</p>
  
  <p>Actual swagger url: /api/mydocs</p>
  
  <p>What is have to do to make it work is have <code>@ApplicationPath("")</code> in Applications and <code>@Path("/docs/mydocs")</code> in Resources, but I don't want to change all of our paths arbitrarily like that just to make it work with Swagger. </p>
  
  <p><a href="https://github.com/swagger-api/swagger-core/issues/2489" rel="nofollow noreferrer">There's a ticket on swagger's github that has been resolved, but for some reason it doesn't work for me (I am using what I think is the latest.)</a></p>
  
  <pre><code>@ApplicationPath( "/docs" )
  @Api( tags = "docs" )
  public class DocsConfig extends Application {
  
      public DocsConfig() {
          BeanConfig beanConfig = new BeanConfig();
          beanConfig.setVersion( "1.0" );
          beanConfig.setSchemes( new String[]{ "http" } );
          beanConfig.setHost( "localhost:8080" );
          beanConfig.setBasePath( "/api" );
          beanConfig.setResourcePackage( "com.my.company" );
          beanConfig.setScan( true );
          beanConfig.setTitle( "MY API" );
  
      }
  
      @Override
      public Set&lt;Class&lt;?&gt;&gt; getClasses() {
          Set&lt;Class&lt;?&gt;&gt; resources = new HashSet&lt;&gt;();
          resources.add( io.swagger.jaxrs.listing.ApiListingResource.class );
          resources.add( io.swagger.jaxrs.listing.SwaggerSerializers.class );
          resources.add( DocsResource.class );
          return resources;
      }
  }
  
  @Stateless
  @Path( "/mydocs" )
  @Api( value = "mydocs" )
  public class DocsResource {
  
      @Context
      ServletContext servletContext;
  
      @Path( "/ui" )
      @GET
      public InputStream getFile() {
          //some stuff
      }
  }
  
      &lt;dependency&gt;
          &lt;groupId&gt;io.swagger&lt;/groupId&gt;
          &lt;artifactId&gt;swagger-jaxrs&lt;/artifactId&gt;
          &lt;version&gt;1.5.18&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>