title: How to create a custom POST request-body in SwaggerUI
body: <p>Im trying to get SwaggerUI look properly working for me. I have a bunch of POST Methods and SwaggerUI does already generate a response and request body in the Web-UI, however the request body is not correct. How do i create a custom request-body for my POST Methods?</p>
  
  <p>The <strong>SpringFoxConfig</strong> is</p>
  
  <pre><code>import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.web.bind.annotation.RequestMethod;
  
  import com.google.common.collect.ImmutableList;
  
  import springfox.documentation.builders.PathSelectors;
  import springfox.documentation.builders.RequestHandlerSelectors;
  import springfox.documentation.service.ApiInfo;
  import springfox.documentation.service.ResponseMessage;
  import springfox.documentation.spi.DocumentationType;
  import springfox.documentation.spring.web.plugins.Docket;
  import springfox.documentation.swagger2.annotations.EnableSwagger2;
  
  @Configuration
  @EnableSwagger2
  public class SpringFoxConfig {
      @Bean
      public Docket apiDocket() {
          return new Docket(DocumentationType.SWAGGER_2)
                  .useDefaultResponseMessages(false)
                  //.globalResponseMessage(RequestMethod.POST, ImmutableList.of(new ResponseMessage(200, "Some global OK message",null)))
                  .select()
                  .apis(RequestHandlerSelectors.any())
                  .paths(PathSelectors.any())
                  .build()            
                  .apiInfo(getApiInfo()); 
      }
  
      private ApiInfo getApiInfo() {
          return new ApiInfo("RESTlike API",
                  "An Api to call functions",
                  "",
                  "",
                  "",
                  "",
                  "");
      }
  }
  </code></pre>
  
  <p><strong>For Example</strong>
  The schema displayed in the UI is</p>
  
  <pre><code>{
  "da": "MD5",
    "data": {
      "value": [
        "string"
      ]
    }
  }
  </code></pre>
  
  <p>This is not <strong>the correct input</strong> the and would throw an error.
  The <strong>correct input</strong> would in this example be:</p>
  
  <pre><code>{
  "da": "MD5",
  "data": "String"
  }
  </code></pre>
  
  <p>Where does the data the schema has come from and how can i change it/override it.</p>
  
  <p>The corresponding <strong>method</strong> would be</p>
  
  <pre><code>@ResponseBody
  @PostMapping("/digest")
  public StringWrapper digestData(@RequestBody DigestDataContainer params) throws IOException {
      return new StringWrapper(//code);
  }
  </code></pre>
  
  <p>DigestDataContainer simply contains a bytearray 'data' and an enum 'da'</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Okay, i found out why the generated response body is wrong, swagger determinates the parameters of the request body by looking at the public parameters and <strong>all</strong> getters. Since i do not have only getters related to parameters in my methods there are too much displayed in the UI.
  You can prevent a parameter being shown in the UI by annotating it with</p>
  
  <pre><code>@ApiModelProperty(required = false, hidden = true)
  </code></pre>
  
  <p>However, i don't have i unique body for every method of mine, i have grouped some of them, which leads to the generated request-body in the UI not being accurate to the method it is in. Hence i want to not show the body at all in the UI.</p>
  
  <ul>
  <li>Is there a way to disable the model schema for the request?</li>
  </ul>