title: I've generated my API server with openapi-generator-maven-plugin what now?
body: <p>I must be missing something obvious will be my epitaph. I've create a swagger 2.0 doc to represent a simple API. It has one POST operation that returns an Integer. I used the openapi-generator-maven-plugin plugin to generate controllers, models, etc in my Spring Boot project. </p>
  
  <p><strong>How do I create a controller to handle the request?</strong> </p>
  
  <p>Looking in <code>/work-queue-api/target/generated-sources/openapi/src/main/java</code> I see 3 things. <code>ApiUtil.java</code>, <code>WorkItemApi.java</code> (interface), <code>WorkItemApiController.java</code> (implementation)</p>
  
  <p>I created a new controller in my application that implements WorkItemApiController. But when I do that Spring complains that its methods are already mapped. </p>
  
  <p>The API "works" in that I can start it and use the Swagger UI to POST. But obviously the request is not actually handled and a default response is returned. The generated interface is pasted below. It has one implemented method. I want to able to call a service in that method. Or a method that overrides it. </p>
  
  <p>Here is the generated interface for WorkItemApi</p>
  
  <pre><code>/**
   * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (4.0.2).
   * https://openapi-generator.tech
   * Do not edit the class manually.
   */
  package com.etisoftware.work_queue.webapi.controller.v1;
  
  import com.etisoftware.work_queue.webapi.model.v1.Error;
  import com.etisoftware.work_queue.webapi.model.v1.NewWorkItem;
  import com.etisoftware.work_queue.webapi.model.v1.WorkItemResponse;
  import io.swagger.annotations.*;
  import org.springframework.http.HttpStatus;
  import org.springframework.http.MediaType;
  import org.springframework.http.ResponseEntity;
  import org.springframework.validation.annotation.Validated;
  import org.springframework.web.bind.annotation.PathVariable;
  import org.springframework.web.bind.annotation.RequestBody;
  import org.springframework.web.bind.annotation.RequestHeader;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RequestParam;
  import org.springframework.web.bind.annotation.RequestPart;
  import org.springframework.web.context.request.NativeWebRequest;
  import org.springframework.web.multipart.MultipartFile;
  
  import javax.validation.Valid;
  import javax.validation.constraints.*;
  import java.util.List;
  import java.util.Map;
  import java.util.Optional;
  
  @Validated
  @Api(value = "WorkItem", description = "the WorkItem API")
  public interface WorkItemApi {
  
      default Optional&lt;NativeWebRequest&gt; getRequest() {
          return Optional.empty();
      }
  
      @ApiOperation(value = "Adds a new workItem", nickname = "v1WorkItemsPost", notes = "", response = WorkItemResponse.class, tags={ "workItem", })
      @ApiResponses(value = { 
          @ApiResponse(code = 200, message = "OK", response = WorkItemResponse.class),
          @ApiResponse(code = 201, message = "Successful operation", response = WorkItemResponse.class),
          @ApiResponse(code = 400, message = "Bad Request", response = Error.class),
          @ApiResponse(code = 401, message = "Unauthorized"),
          @ApiResponse(code = 403, message = "Forbidden", response = Error.class),
          @ApiResponse(code = 404, message = "Not Found"),
          @ApiResponse(code = 500, message = "Internal server error", response = Error.class) })
      @RequestMapping(value = "/v1/work-items",
          produces = { "application/problem+json", "application/json" }, 
          consumes = { "application/json" },
          method = RequestMethod.POST)
      default ResponseEntity&lt;WorkItemResponse&gt; v1WorkItemsPost(@ApiParam(value = "Parameters to represent a new work item." ,required=true )  @Valid @RequestBody NewWorkItem newWorkItem) {
          getRequest().ifPresent(request -&gt; {
              for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
                  if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
                      ApiUtil.setExampleResponse(request, "application/json", "{  \"controllerWorkNumber\" : 0.8008281904610115}");
                      break;
                  }
              }
          });
          return new ResponseEntity&lt;&gt;(HttpStatus.valueOf(200));
  
      }
  
  }
  
  </code></pre>
  
  <h2>Plugin config in pom.xml</h2>
  
  <pre><code>&lt;plugin&gt;
          &lt;groupId&gt;org.openapitools&lt;/groupId&gt;
          &lt;artifactId&gt;openapi-generator-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;4.0.2&lt;/version&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;goals&gt;
                &lt;goal&gt;generate&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                &lt;inputSpec&gt;${project.basedir}/src/main/resources/swagger.yaml&lt;/inputSpec&gt;
                &lt;generatorName&gt;spring&lt;/generatorName&gt;
                &lt;addCompileSourceRoot&gt;true&lt;/addCompileSourceRoot&gt;
                &lt;configOptions&gt;
                  &lt;basePackage&gt;com.etisoftware.work_queue&lt;/basePackage&gt;
                  &lt;configPackage&gt;
                    com.etisoftware.work_queue.webapi.configuration
                  &lt;/configPackage&gt;
                  &lt;apiPackage&gt;
                    com.etisoftware.work_queue.webapi.controller.v1
                  &lt;/apiPackage&gt;
                  &lt;modelPackage&gt;
                    com.etisoftware.work_queue.webapi.model.v1
                  &lt;/modelPackage&gt;
                  &lt;invokerPackage&gt;
                    com.etisoftware.work_queue
                  &lt;/invokerPackage&gt;
                  &lt;swaggerDocketConfig&gt;true&lt;/swaggerDocketConfig&gt;
                  &lt;useOptional&gt;true&lt;/useOptional&gt;
                  &lt;returnSuccessCode&gt;true&lt;/returnSuccessCode&gt;
                  &lt;useTags&gt;true&lt;/useTags&gt;
                  &lt;virtualService&gt;false&lt;/virtualService&gt;
                  &lt;dateLibrary&gt;java8&lt;/dateLibrary&gt;
                  &lt;hideGenerationTimestamp&gt;true&lt;/hideGenerationTimestamp&gt;
                &lt;/configOptions&gt;
              &lt;/configuration&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
        &lt;/plugin&gt;
  </code></pre>