GithubHelp home page GithubHelp logo

ender74 / swagger-codegen-tooling Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zalando-stups/swagger-codegen-tooling

0.0 2.0 0.0 846 KB

Tooling around Maven and Gradle to generate code from OpenAPI/Swagger specs

Home Page: https://stups.io/swagger-codegen-tooling

License: Apache License 2.0

Java 49.74% Groovy 11.81% HTML 38.45%

swagger-codegen-tooling's Introduction

Swagger-Codegen-Tooling

Build Status Javadoc Release Maven Central License

The project provides some tooling around Maven and Gradle* to generate code from OpenAPI-Specs. It comes with custom-templates to support Spring-MVC/Spring-Boot projects. Instead of generating code only once when a project starts (design phase), code will be generated at every build to make sure your code is in sync with your spec. So controllers/resources are generated as interfaces developers have to implement then. So changes in the spec should be reflected immediately on build/compile-step.

Getting started with Maven

To get started in a Maven project just add the following plugin-definition to you pom.xml.

    <plugin>
        <groupId>org.zalando.maven.plugins</groupId>
        <artifactId>swagger-codegen-maven-plugin</artifactId>
        <version>${version}</version>
        <configuration>
            <apiFile>${project.basedir}/src/main/resources/api.yaml</apiFile>
            <language>springinterfaces</language>
            <apiPackage>com.example.project.api</apiPackage>
            <modelPackage>com.example.project.model</modelPackage>
        </configuration>
        <executions>
            <execution>
                <id>swagger-codegen</id>
                <goals>
                    <goal>codegen</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

According to your OpenAPI-spec (api.yaml) code will be generated in ${basedir}/target/generated-sources/swagger-codegen

More examples how to use the Maven-Plugin can be found in the integration-test section.

Development/Contribution

Build

The project itself uses Maven:

mvn clean install

Run with integration-tests enabled

mvn clean install -Pintegration

TODO's

API-SPEC

https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/3.0.md

Contributions

Many thanks to ePaul for reporting issues and code-contributions.

License

Copyright 2015-2017 Zalando SE

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

swagger-codegen-tooling's People

Contributors

ender74 avatar epaul avatar jbellmann avatar kkrauth avatar otrosien avatar

Watchers

 avatar  avatar

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.