Skip to content

Latest commit

 

History

History
66 lines (51 loc) · 1.98 KB

README.md

File metadata and controls

66 lines (51 loc) · 1.98 KB

SWAGGER TO RETROFIT

The module provide generation of retrofit services and models.

Getting Started

run mvn compile if prepared phase compile
plugin can be executed directly: mvn swagger-to-retrofit:generate

setup

need prepare pom with parameter io.github.phantomstr.testing.tool.swagger2retrofit.swagger2retrofit.commandline
where
required
-u or --url : path to swagger api
optional
-mp or --modelsPackage : package where will be compiled models
-sp or --servicePackage : package where will be compiled services
-ar or --apiRoot : root of api. Will be removed from path start
-sf or --serviceFilters : regexp filter of generated services
example:

<project>
  <properties>
    <io.github.phantomstr.testing.tool.swagger2retrofit.swagger2retrofit.commandline>-u http://localhost:8080/v2/api-docs -mp io.github.phantomstr.testing.tool.rest.model -sp
      io.github.phantomstr.testing.tool.rest.service
    </io.github.phantomstr.testing.tool.swagger2retrofit.swagger2retrofit.commandline>
  </properties>
  <build>
    <plugins>
      <plugin>
        <groupId>io.github.phantomstr.testing-tools</groupId>
        <artifactId>swagger-to-retrofit</artifactId>
        <version>1.1.8</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Prerequisites

  • For scheme generation lombok 1.18.20 in local repository is required.

  • Lombok plugin required File | Settings | Plugins | Marketplace | find "lombok" | install

  • Annotation processing required (check option):
    File | Settings | Build, Execution, Deployment | Compiler | Annotation Processors |Enable annotation processing

Built With

  • Maven - Dependency Management

Versioning

We use SemVer for versioning.