GithubHelp home page GithubHelp logo

openapi-generator-cxf-wso2's Introduction

Before you begin, convert the API definition to OpenAPI 3.0 if you already haven't done so.

  1. Clone this repository and build the plugin.
  2. Include the given plugin to the pom.xml file of the module org.wso2.carbon.identity.api.server.<resource>.<version>
<plugin>
    <groupId>org.openapitools</groupId>
    <artifactId>openapi-generator-maven-plugin</artifactId>
    <version>4.1.2</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <inputSpec>${project.basedir}/src/main/resources/<resource>.yaml</inputSpec>
                <generatorName>org.wso2.carbon.codegen.CxfWso2Generator</generatorName>
                <configOptions>
                    <sourceFolder>src/gen/java</sourceFolder>
                    <apiPackage>org.wso2.carbon.identity.api.server.<resource>.<version></apiPackage>
                    <modelPackage>org.wso2.carbon.identity.api.server.<resource>.<version>.model</modelPackage>
                    <packageName>org.wso2.carbon.identity.api.server.<resource>.<version></packageName>
                    <dateLibrary>java8</dateLibrary>
                    <hideGenerationTimestamp>true</hideGenerationTimestamp>
                </configOptions>
                <output>.</output>
                <skipOverwrite>false</skipOverwrite>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.openapitools</groupId>
            <artifactId>cxf-wso2-openapi-generator</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>
</plugin>

For example:

<plugin>
    <groupId>org.openapitools</groupId>
    <artifactId>openapi-generator-maven-plugin</artifactId>
    <version>4.1.2</version>
    <executions>
        <execution>
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <inputSpec>${project.basedir}/src/main/resources/identity-governance-3.yaml</inputSpec>
                <generatorName>org.wso2.carbon.codegen.CxfWso2Generator</generatorName>
                <configOptions>
                    <sourceFolder>src/gen/java</sourceFolder>
                    <apiPackage>org.wso2.carbon.identity.api.server.identity.governance.v1</apiPackage>
                    <modelPackage>org.wso2.carbon.identity.api.server.identity.governance.v1.model</modelPackage>
                    <packageName>org.wso2.carbon.identity.api.server.identity.governance.v1</packageName>
                    <dateLibrary>java8</dateLibrary>
                    <hideGenerationTimestamp>true</hideGenerationTimestamp>
                </configOptions>
                <output>.</output>
                <skipOverwrite>false</skipOverwrite>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.openapitools</groupId>
            <artifactId>cxf-wso2-openapi-generator</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>
</plugin>
  1. Run the following command inside the module org.wso2.carbon.identity.api.server.. to generate the stubs
mvn clean install
  1. Comment out the plugin added for your API definition before committing to the git.

Supported vendor extensions

Extension Purpose Description Example
x-gen-include-req-res Get the HttpServletRequest and the HttpServletResponse objects to the generated code. Should be added to root of the yaml. If the value is set to true then the request and response objects will be available in the generated api impl classes. x-gen-include-req-res: true

openapi-generator-cxf-wso2's People

Contributors

madurangasiriwardena avatar emswbandara avatar pamodaaw avatar vihanga-liyanage avatar janakamarasena avatar deshankoswatte avatar dewnimw avatar rushannanayakkara avatar

Stargazers

Jayana  Gunaweera avatar Pushpalanka Jayawardhana avatar

Watchers

James Cloos avatar  avatar  avatar

openapi-generator-cxf-wso2's Issues

Test Failure Occur while building.

While building using mvn clean install following error occurs.

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Concurrency config is parallel='methods', perCoreThreadCount=true, threadCount=2, useUnlimitedThreads=false
Running org.wso2.carbon.codegen.CxfWso2GeneratorTest
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.267 sec <<< FAILURE!

Results :

Tests in error: 
  launchCodeGenerator(org.wso2.carbon.codegen.CxfWso2GeneratorTest)

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.