title: Swagger/OpenAPI: How to integrate generation of typescript/angular client in build process?
body: <p><strong>Java/Spring Server-Stubs Generation with swagger-codegen-maven-plugin</strong></p>
  
  <p>In my Spring Boot Java project I am using <a href="https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen-maven-plugin" rel="noreferrer">swagger-codegen-maven-plugin</a> to generate the Spring MVC controller interfaces (server stubs) from my Swagger 2.0 api.yml. The integration in the maven build process is quite simple. It works simliar as I used to do it with the jaxws-maven-plugin for WSDLs. This is the example configuration from the pom.xml with swagger-codegen. It generates the server side model and mvc interfaces:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
      &lt;groupId&gt;io.swagger&lt;/groupId&gt;
      &lt;artifactId&gt;swagger-codegen-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.2.3&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;/api/api-v2.yml&lt;/inputSpec&gt;
                  &lt;language&gt;spring&lt;/language&gt;
                  &lt;apiPackage&gt;io.fischermatte.test.api&lt;/apiPackage&gt;
                  &lt;modelPackage&gt;io.fischermatte.test.api.model&lt;/modelPackage&gt;
                  &lt;output&gt;${project.build.directory}/generated&lt;/output&gt;
                  &lt;configOptions&gt;
                      &lt;interfaceOnly&gt;true&lt;/interfaceOnly&gt;
                      &lt;sourceFolder&gt;/src/main/java&lt;/sourceFolder&gt;
                      &lt;library&gt;spring-mvc&lt;/library&gt;
                      &lt;dateLibrary&gt;java8&lt;/dateLibrary&gt;
                  &lt;/configOptions&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p><strong>But how to integrate the same thing in a npm build process of a client angular app ?</strong></p>
  
  <p>Now I am trying to integrate the generation of the client code in the npm build process of my angular app. I have an api.yml defining my rest endpoints based on Swagger 2.0. I want the npm build to generate the api module similar to this <a href="https://github.com/swagger-api/swagger-codegen/tree/master/samples/client/petstore/typescript-angular-v4.3/npm" rel="noreferrer">typescript-angular-v4.3</a> sample. As much as I have seen, there is no official package for npm that does this like swagger-codegen-maven-plugin is doing it when you are using maven. </p>
  
  <p>Did I misunderstand something here? The sample mentioned above is already the outcome, but what is the recommended approach to get there? Is such an integration in a npm based project not the way to go? Should one do it manually and check the generated typescript files into the sources directory?   </p>