Skip to content

Commit ad007b8

Browse files
authored
Merge pull request #42 from hiit-consulting-fr/feat/switch-to-openapi-generator
feat(project): switch to openapi-generator
2 parents 6fc79b8 + 5233c4c commit ad007b8

21 files changed

+817
-501
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,16 @@ jobs:
1818
distribution: 'temurin'
1919
cache: maven
2020

21-
- name: Maven build & test
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20.x
24+
25+
- name: Lint
2226
run: >-
23-
mvn
24-
-Pcoverage
25-
clean verify
26-
env:
27-
GITHUB_TOKEN: ${{ github.token }}
27+
npx @redocly/cli lint
2828
29-
- name: Coveralls Coverage Report Submission
29+
- name: Maven build
3030
run: >-
31-
mvn
32-
-Pcoverage
33-
coveralls:report
31+
mvn clean verify
3432
env:
3533
GITHUB_TOKEN: ${{ github.token }}
36-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN}}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@
88
### Maven ###
99
target/
1010

11+
### gen ###
12+
gen/*
13+
!gen/.openapi-generator-ignore
14+
!gen/.mvn/maven.config
15+
1116
### Node ###
1217
node_modules

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# ipaidthat-proxy
1+
# ipaidthat-java-client
22

33
[![build](https://github.com/hiit-consulting-fr/ipaidthat-proxy/actions/workflows/build.yml/badge.svg)](https://github.com/hiit-consulting-fr/ipaidthat-proxy/actions/workflows/build.yml)
44
![GitHub](https://img.shields.io/github/license/hiit-consulting-fr/ipaidthat-proxy)
55
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/hiit-consulting-fr/ipaidthat-proxy)
6-
[![Coverage Status](https://coveralls.io/repos/github/hiit-consulting-fr/ipaidthat-proxy/badge.svg?branch=master)](https://coveralls.io/github/hiit-consulting-fr/ipaidthat-proxy?branch=master)
76

8-
Common code to access iPaidThat Api
7+
Java client to access iPaidThat Api

gen/.openapi-generator-ignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
docs/
2+
api/
3+
.openapi-generator/
4+
5+
# gradle
6+
gradle/
7+
build.gradle
8+
gradlew
9+
gradlew.bat
10+
gradle.properties
11+
settings.gradle
12+
13+
# ci
14+
.travis.yml
15+
.github/
16+
git_push.sh
17+
.gitignore
18+
19+
# scala
20+
build.sbt
21+
22+
# android
23+
src/main/AndroidManifest.xml
24+
25+
# tests
26+
src/test/
27+
28+
# maven
29+
pom.xml
30+
31+
README.md

lombok.config

Lines changed: 0 additions & 4 deletions
This file was deleted.

pom.xml

Lines changed: 58 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<artifactId>ipaidthat-proxy</artifactId>
8-
<groupId>fr.hiit</groupId>
9-
<version>1.0.0-SNAPSHOT</version>
7+
<artifactId>ipaidthat-java-client</artifactId>
8+
<groupId>fr.hiitconsulting</groupId>
9+
<version>3.2.0-SNAPSHOT</version>
1010

1111
<name>${project.artifactId}</name>
1212

@@ -18,23 +18,24 @@
1818

1919
<!-- Dependency versions -->
2020
<ms-parent.version>1.5.0</ms-parent.version>
21+
<jackson-databind-nullable.version>0.2.6</jackson-databind-nullable.version>
2122

2223
<!-- Plugin versions -->
24+
<maven-clean-plugin.version>3.3.2</maven-clean-plugin.version>
2325
<maven-source-plugin.version>3.3.0</maven-source-plugin.version>
24-
<maven-surefire-plugin.version>3.2.2</maven-surefire-plugin.version>
25-
<jacoco-maven-plugin.version>0.8.10</jacoco-maven-plugin.version>
26+
<openapi-generator-maven-plugin.version>7.0.1</openapi-generator-maven-plugin.version>
2627
</properties>
2728

2829
<scm>
29-
<url>https://github.com/hiit-consulting-fr/ipaidthat-proxy</url>
30+
<url>https://github.com/hiit-consulting-fr/ipaidthat-java-client</url>
3031
</scm>
3132

3233
<issueManagement>
33-
<url>https://github.com/hiit-consulting-fr/ipaidthat-proxy/issues</url>
34+
<url>https://github.com/hiit-consulting-fr/ipaidthat-java-client/issues</url>
3435
</issueManagement>
3536

3637
<ciManagement>
37-
<url>https://github.com/hiit-consulting-fr/ipaidthat-proxy/actions</url>
38+
<url>https://github.com/hiit-consulting-fr/ipaidthat-java-client/actions</url>
3839
</ciManagement>
3940

4041
<organization>
@@ -61,46 +62,16 @@
6162
<groupId>org.springframework.boot</groupId>
6263
<artifactId>spring-boot-starter-web</artifactId>
6364
</dependency>
64-
<dependency>
65-
<groupId>org.springframework.cloud</groupId>
66-
<artifactId>spring-cloud-starter-openfeign</artifactId>
67-
</dependency>
68-
<dependency>
69-
<groupId>org.springframework.boot</groupId>
70-
<artifactId>spring-boot-starter-validation</artifactId>
71-
</dependency>
72-
<dependency>
73-
<groupId>org.springframework.boot</groupId>
74-
<artifactId>spring-boot-configuration-processor</artifactId>
75-
<optional>true</optional>
76-
</dependency>
7765

7866
<!-- Others -->
7967
<dependency>
80-
<groupId>org.projectlombok</groupId>
81-
<artifactId>lombok</artifactId>
82-
<optional>true</optional>
68+
<groupId>org.openapitools</groupId>
69+
<artifactId>jackson-databind-nullable</artifactId>
70+
<version>${jackson-databind-nullable.version}</version>
8371
</dependency>
84-
85-
<dependency>
86-
<groupId>org.springframework.boot</groupId>
87-
<artifactId>spring-boot-starter-test</artifactId>
88-
<scope>test</scope>
89-
</dependency>
90-
9172
</dependencies>
9273

9374
<build>
94-
<pluginManagement>
95-
<plugins>
96-
<plugin>
97-
<groupId>org.apache.maven.plugins</groupId>
98-
<artifactId>maven-surefire-plugin</artifactId>
99-
<version>${maven-surefire-plugin.version}</version>
100-
</plugin>
101-
</plugins>
102-
</pluginManagement>
103-
10475
<plugins>
10576
<plugin>
10677
<groupId>org.apache.maven.plugins</groupId>
@@ -116,14 +87,59 @@
11687
</execution>
11788
</executions>
11889
</plugin>
90+
<plugin>
91+
<groupId>org.apache.maven.plugins</groupId>
92+
<artifactId>maven-clean-plugin</artifactId>
93+
<version>${maven-clean-plugin.version}</version>
94+
<configuration>
95+
<filesets>
96+
<fileset>
97+
<directory>gen</directory>
98+
<excludes>
99+
<exclude>**/.openapi-generator-ignore</exclude>
100+
<exclude>**/maven.config</exclude>
101+
</excludes>
102+
</fileset>
103+
</filesets>
104+
</configuration>
105+
</plugin>
106+
<plugin>
107+
<groupId>org.openapitools</groupId>
108+
<artifactId>openapi-generator-maven-plugin</artifactId>
109+
<version>${openapi-generator-maven-plugin.version}</version>
110+
<executions>
111+
<execution>
112+
<goals>
113+
<goal>generate</goal>
114+
</goals>
115+
<configuration>
116+
<inputSpec>swagger.yml</inputSpec>
117+
<output>${project.basedir}/gen</output>
118+
<generatorName>java</generatorName>
119+
<apiPackage>${project.groupId}.ipaidthat.client.api</apiPackage>
120+
<modelPackage>${project.groupId}.ipaidthat.client.model</modelPackage>
121+
<invokerPackage>${project.groupId}.ipaidthat.client.invoker</invokerPackage>
122+
<groupId>${project.groupId}</groupId>
123+
<artifactId>ipaidthat-java-client</artifactId>
124+
<artifactVersion>${project.version}</artifactVersion>
125+
<skipValidateSpec>true</skipValidateSpec>
126+
<configOptions>
127+
<dateLibrary>java8</dateLibrary>
128+
<library>resttemplate</library>
129+
<useJakartaEe>true</useJakartaEe>
130+
</configOptions>
131+
</configuration>
132+
</execution>
133+
</executions>
134+
</plugin>
119135
</plugins>
120136
</build>
121137

122138
<distributionManagement>
123139
<repository>
124140
<id>github</id>
125141
<name>GitHub Hi!t Consulting Apache Maven Packages</name>
126-
<url>https://maven.pkg.github.com/hiit-consulting-fr/ipaidthat-proxy</url>
142+
<url>https://maven.pkg.github.com/hiit-consulting-fr/ipaidthat-java-client</url>
127143
</repository>
128144
</distributionManagement>
129145

@@ -137,49 +153,4 @@
137153
<url>https://maven.pkg.github.com/hiit-consulting-fr/ms-parent</url>
138154
</repository>
139155
</repositories>
140-
141-
<profiles>
142-
<profile>
143-
<id>coverage</id>
144-
<build>
145-
<plugins>
146-
<plugin>
147-
<groupId>org.jacoco</groupId>
148-
<artifactId>jacoco-maven-plugin</artifactId>
149-
<version>${jacoco-maven-plugin.version}</version>
150-
<executions>
151-
<execution>
152-
<goals>
153-
<goal>prepare-agent</goal>
154-
</goals>
155-
</execution>
156-
<execution>
157-
<id>generate-code-coverage-report</id>
158-
<phase>test</phase>
159-
<goals>
160-
<goal>report</goal>
161-
</goals>
162-
</execution>
163-
</executions>
164-
</plugin>
165-
<plugin>
166-
<groupId>org.eluder.coveralls</groupId>
167-
<artifactId>coveralls-maven-plugin</artifactId>
168-
<version>4.3.0</version>
169-
<configuration>
170-
<repoToken>${env.COVERALLS_REPO_TOKEN}</repoToken>
171-
</configuration>
172-
<dependencies>
173-
<dependency>
174-
<groupId>javax.xml.bind</groupId>
175-
<artifactId>jaxb-api</artifactId>
176-
<version>2.3.1</version>
177-
</dependency>
178-
</dependencies>
179-
</plugin>
180-
</plugins>
181-
</build>
182-
</profile>
183-
</profiles>
184-
185156
</project>

redocly.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# See https://redocly.com/docs/cli/configuration/
2+
3+
apis:
4+
# Update the apiName with your actual API name, and the version with your actual API version.
5+
mulesfot-client@v1:
6+
# Update the path to your OpenAPI root file
7+
root: ./swagger.yml
8+
9+
extends:
10+
- minimal

src/main/java/fr/hiit/ipaidthat/configuration/IPTAutoConfiguration.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/main/java/fr/hiit/ipaidthat/configuration/IPTErrorDecoder.java

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/main/java/fr/hiit/ipaidthat/configuration/IPTProperties.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)