This repository contains modules related to the user identity apis feature
To generate stub, the swagger2cxf-maven-plugin is used.
We have done improvements to this plugin so that the stubs can be generated within a given package name. Therefore you can define multiple swagger files and deploy them in a single web application. To get the improvements locally, please follow the given steps.
- Clone the repository https://github.com/IsuraD/swagger2cxf-maven-plugin
git clone https://github.com/IsuraD/swagger2cxf-maven-plugin.git
- Checkout the branch swagger_to_jar
git checkout swagger_to_jar
- Build the plugin
mvn clean install
Now, the locally built swagger2cxf plugin will be picked from the local .m2 repository when generating the stubs.
- Include the API definition in the given location of this maven project (identity-api). Assume the file name of the
API definition is api.yaml
+-- identity-user-api | +-- components | +-- org.wso2.carbon.identity.api.user.<resource> | +-- src | +-- main | +-- resources | +--api.yaml | +-- pom.xml
- Include the given plugin to the
pom.xml
file of the moduleorg.wso2.carbon.identity.api.endpoint
Give the required package name for generated stubs as<plugin> <groupId>org.wso2.maven.plugins</groupId> <artifactId>swagger2cxf-maven-plugin</artifactId> <version>1.0-SNAPSHOT</version> <configuration> <packageName>association</packageName> <inputSpec>${project.basedir}/src/main/resources/api.yaml</inputSpec> </configuration> </plugin>
<packageName>
and the file path to API definition yaml file as<inputSpec>
- Run the following command inside the module
org.wso2.carbon.identity.api.endpoint
to generate the stubsmvn swagger2cxf:generate
- Comment out the plugin added for your API definition before committing to the git.