title: How to document additional models in Swagger for an inaccessible Controller?
body: <p>I have a controller that I have to keep generic by having it accept a <code>String</code> as <code>@RequestBody</code> and return a String, i.e., <code>String processRequest(@RequestBody String json) {...}</code></p>
  
  <p><strong>I don't have control over the source code of that controller, but I can get to it programmatically.</strong></p>
  
  <p>The real objects that are going to be passed in and returned are defined elsewhere in a series of request messages: <code>RequestMessage1.java</code>, <code>RequestMessage2.java</code>, etc. Responses are likewise: <code>Response1.java</code>, <code>Response2.java1</code>.</p>
  
  <p>The controller also hands off the processing of these requests to a <code>Processor</code> that looks something like this (<code>Request1Processor.java</code>): <code>Response1 process(RequestMessage1 message)</code>.</p>
  
  <p>My question is this. </p>
  
  <p>Is there a way to configure swagger such that it exposes the REST controller class's endpoint, i.e, <code>processRequest</code>, but shows all these Processor classes with their inputs and outputs as the documentation for that controller?</p>
  
  <p>I saw as part of documentation the ability to add models that are not "reachable". I tried the method that's in documentation like this:</p>
  
  <pre><code>@Autowired
  private TypeResolver typeResolver;
  
  @Bean
  public Docket api() {
    return new Docket(DocumentationType.SWAGGER_2)
        .select()
        .apis(RequestHandlerSelectors.any())
        .paths(PathSelectors.any())
        .build()
        .additionalModels(typeResolver.resolve(Date.class));
  }
  </code></pre>
  
  <p>However, the additional Date model did not show up in swagger-ui.html.</p>
  
  <p>What am I doing wrong here?</p>
  
  <p>Also, is there a way to somehow show that <code>RequestMessage1</code> type will have a response with <code>Response1</code>?</p>