Hi,

I have used the Swagger Codegen to generation the server stubs from a
Swagger definition of a REST API for IS 5.4.0.

In there I have added the following plugin to generate server stub for CXF.

<plugin>
>     <groupId>org.wso2.maven.plugins</groupId>
>     <artifactId>swagger2cxf-maven-plugin</artifactId>
>     <version>1.0-SNAPSHOT</version>
>     <configuration>
>
> <inputSpec>${project.basedir}/src/main/resources/api.identity.oauth2.scope.endpoint.yaml</inputSpec>
>     </configuration>
> </plugin>
>


Also add the following maven build helper plugin.

<plugin>
>     <groupId>org.codehaus.mojo</groupId>
>     <artifactId>build-helper-maven-plugin</artifactId>
>     <executions>
>         <execution>
>             <id>add-source</id>
>                         <phase>generate-sources</phase>
>                         <goals>
>                             <goal>add-source</goal>
>                         </goals>
>                         <configuration>
>                             <sources>
>                                 <source>src/gen/java</source>
>                             </sources>
>                         </configuration>
>                     </execution>
>     </executions>
> </plugin>
>

Then use "mvn swagger2cxf:generate" command to generate the server stubs
and in src/gen/java folder, set of factories are generated and in main/Java
folder, a set of impl files are generated.

I have following concerns regarding server stubs generation from Swagger.

   - Is this can be automated to do in component build? Or normally this is
   the way it should handled and need to commit all the generated files to git
   as well?


   - If we are committing the generated files to git, is it recommended to
   add class comments in those?


Thanks and Regards

-- 
Indunil Upeksha Rathnayake
Software Engineer | WSO2 Inc
Email    [email protected]
Mobile   0772182255
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to