Skip to content

Commit d07e238

Browse files
authored
Merge pull request #437 from Backbase/test-merge
WIP: Upgrade OpenAPI Generator 6.3.0 and support for Jakarta
2 parents 2876a1e + 3fa1097 commit d07e238

File tree

828 files changed

+19447
-22595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

828 files changed

+19447
-22595
lines changed

.github/workflows/boat.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/setup-java@v3
1717
with:
1818
distribution: 'microsoft'
19-
java-version: '11'
19+
java-version: '17'
2020
cache: 'maven'
2121
- name: Build & Test
2222
run: mvn -B test
@@ -31,10 +31,42 @@ jobs:
3131
uses: actions/setup-java@v3
3232
with:
3333
distribution: 'microsoft'
34-
java-version: '11'
34+
java-version: '17'
3535
cache: 'maven'
3636
- name: Build and Analyze
3737
env:
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4040
run: mvn -B verify sonar:sonar -Dgpg.skip
41+
publish:
42+
if: "!contains(github.event.head_commit.message, '[version bump]')"
43+
runs-on: ubuntu-latest
44+
needs: [ test, sonar ]
45+
steps:
46+
- name: Checkout project
47+
uses: actions/checkout@v3
48+
49+
- name: Setup Java
50+
uses: actions/setup-java@v3
51+
with:
52+
distribution: 'microsoft'
53+
java-version: '17'
54+
cache: 'maven'
55+
server-id: ossrh
56+
server-username: MAVEN_USERNAME
57+
server-password: MAVEN_PASSWORD
58+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
59+
gpg-passphrase: GPG_PASSPHRASE
60+
61+
- name: Build and Publish SNAPSHOT
62+
run: |
63+
mvn \
64+
--no-transfer-progress \
65+
--batch-mode \
66+
-DskipTests=true \
67+
deploy
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
71+
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
72+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/setup-java@v3
1717
with:
1818
distribution: 'microsoft'
19-
java-version: '11'
19+
java-version: '17'
2020
cache: 'maven'
2121
- name: Build & Test
2222
run: mvn -B test
@@ -31,7 +31,7 @@ jobs:
3131
uses: actions/setup-java@v3
3232
with:
3333
distribution: 'microsoft'
34-
java-version: '11'
34+
java-version: '17'
3535
cache: 'maven'
3636
- name: Build and Analyze
3737
env:
@@ -51,7 +51,7 @@ jobs:
5151
uses: actions/setup-java@v3
5252
with:
5353
distribution: 'microsoft'
54-
java-version: '11'
54+
java-version: '17'
5555
cache: 'maven'
5656
server-id: ossrh
5757
server-username: MAVEN_USERNAME
@@ -114,7 +114,7 @@ jobs:
114114
uses: actions/setup-java@v3
115115
with:
116116
distribution: 'microsoft'
117-
java-version: '11'
117+
java-version: '17'
118118
cache: 'maven'
119119
- name: Configure Git user
120120
run: |

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ hs_err_pid*
3434
.*
3535
# but not git dot files (e.g. .gitattribute)
3636
!.git?*
37+
38+
!boat-scaffold/src/main/templates/boat-java/gradle-wrapper.jar

README.md

Lines changed: 10 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,26 @@ The Backbase Open API Tools is a collection of tools created to work efficiently
77

88
It currently consists of
99

10-
* RAML 1.0 Converter to OpenAPI 3.0
1110
* Create Diff Report between 2 OpenAPI versions of the same spec (Based on https://github.com/quen2404/openapi-diff)
1211
* Decompose Transformer to remove Composed Schemas from OpenAPI specs to aid in code generators
1312
* Case Transformer to see how your API looks like when going from camelCase to snake_case (transforms examples too)
1413
* [Code Generator](boat-maven-plugin/README.md) based on [openapi-generator.tech](https://openapi-generator.tech/) with optimized templates and fixes.
15-
* Lint mojo based on Zalando Zally API Guidelines
14+
* Lint mojo based on Zalando Zally and Backbase API
1615

1716
The project is very much Work In Progress and will be published on maven central when considered ready enough.
1817

1918
# Release Notes
2019
BOAT is still under development and subject to change.
2120

21+
## 0.17.0
22+
* General
23+
* Removed RAML Support
24+
* Update OpenAPI Tools to 6.2.1
25+
* Boat Java Generator
26+
* Jakarta EE 9 compatibility
27+
* `spring-mvc` library is removed because it is not supported by OpenAPI Tools anymore
28+
* Use of `Set` for unique items is now enabled by default as OpenAPI Generator fixed their implementation
29+
2230
## 0.16.11
2331
* Boat Angular generator
2432
* Set `removeComments: false` in generated tsconfig.json files to retain `/*#__PURE__*/` annotation in compiled JS.
@@ -391,172 +399,8 @@ BOAT is still under development and subject to change.
391399
mvn install
392400
```
393401

394-
## CLI Usage
395-
396-
### Convert RAML to Open API 3.0
397-
```shell script
398-
cd boat-terminal
399-
java -jar target/boat-terminal-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
400-
-f src/test/resources/api.raml
401-
```
402-
403-
404-
### Convert RAML to Open API 3.0 && Pipe output to file
405-
```shell script
406-
cd boat-terminal
407-
java -jar target/boat-terminal-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
408-
-f src/test/resources/api.raml \
409-
> openapi.yaml
410-
```
411-
412-
413-
### Convert RAML to Open API 3.0 file and verbose logging
414-
```shell script
415-
cd boat-terminal
416-
java -jar target/boat-terminal-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
417-
-f src/test/resources/api.raml \
418-
-o swagger.yaml \
419-
-v
420-
```
421-
422-
### Convert RAML to Open API 3.0 with examples exploded into <output-dir>/examples/
423-
```shell script
424-
cd boat-terminal
425-
java -jar target/boat-terminal-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
426-
-f src/test/resources/api.raml \
427-
-o swagger.yaml \
428-
-d my-open-api-spec/ \
429-
-v
430-
```
431-
432-
433402
## Maven Plugin Usage
434403

435-
Configuration
436-
437-
```xml
438-
<?xml version="1.0" encoding="UTF-8"?>
439-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
440-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
441-
442-
<modelVersion>4.0.0</modelVersion>
443-
444-
<groupId>my.project</groupId>
445-
<artifactId>my-specs-definition</artifactId>
446-
<version>1.0</version>
447-
<packaging>pom</packaging>
448-
449-
<properties>
450-
<boat-maven-plugin.version>0.1.4</boat-maven-plugin.version>
451-
</properties>
452-
453-
<build>
454-
<plugins>
455-
<plugin>
456-
<groupId>com.backbase.oss</groupId>
457-
<artifactId>boat-maven-plugin</artifactId>
458-
<version>${boat-maven-plugin.version}</version>
459-
<executions>
460-
<execution>
461-
<id>export-raml-spec</id>
462-
<phase>generate-sources</phase>
463-
<goals>
464-
<goal>export</goal>
465-
</goals>
466-
<configuration>
467-
<inputFile>${basedir}/src/main/resources/client-api.raml</inputFile>
468-
</configuration>
469-
</execution>
470-
</executions>
471-
</plugin>
472-
</plugins>
473-
</build>
474-
</project>
475-
```
476-
477-
The following command will convert the given `client-api.raml` file into Open API 3.0 format.
478-
479-
```bash
480-
mvn boat:export
481-
```
482-
483-
**NOTE:** RAML file name should end with `-api.raml`, `service-api.raml` or `client-api.raml`.
484-
485-
## Export All Specifications in Bill-Of-Materials pom file
486-
If you want to export all specifications referenced in a pom file, you can use the following mojo
487-
488-
```xml
489-
<build>
490-
<plugins>
491-
<plugin>
492-
<groupId>com.backbase.boat</groupId>
493-
<artifactId>boat-maven-plugin</artifactId>
494-
<version>${boat-maven-plugin.version}</version>
495-
<configuration>
496-
<specBom>
497-
<groupId>com.backbase.dbs</groupId>-->
498-
<artifactId>banking-services-bom</artifactId>
499-
<version>[2.16.0,)</version>
500-
<type>pom</type>
501-
<!-- Bom equal or higher than 2.16 -->
502-
</specBom>
503-
<output>${project.basedir}/raml-2-openapi-specs</output>
504-
<xLogoUrl>http://www.backbase.com/wp-content/uploads/2017/04/backbase-logo-png.png</xLogoUrl>
505-
<xLogoAltText>Backbase</xLogoAltText>
506-
<markdownBottom># Disclaimer
507-
This API is converted from RAML1.0 using the boat-maven-plugin and is not final or validated!
508-
</markdownBottom>
509-
<addChangeLog>true</addChangeLog>
510-
</configuration>
511-
</plugin>
512-
</plugins>
513-
</build>
514-
515-
```
516-
517-
### Configuration Options
518-
519-
* The `addChangeLog` option will automagically insert a change log between all referenced versions
520-
* The `includeVersionsRegEx` can be used to filter out certain versions. By default it's set to `^(\d+\.)?(\d+\.)?(\d+)$` to only allow x.x.x versions. To also include patch versions, set it to `^(\d+\.)?(\d+\.)?(\d+\.)?(\*|\d+)$`
521-
522-
```bash
523-
mvn boat:export-bom
524-
```
525-
526-
## Generate API docs
527-
528-
Configuration
529-
530-
```xml
531-
<!-- ... -->
532-
533-
<build>
534-
<plugins>
535-
<plugin>
536-
<groupId>com.backbase.oss</groupId>
537-
<artifactId>boat-maven-plugin</artifactId>
538-
<version>${boat-maven-plugin.version}</version>
539-
<executions>
540-
<execution>
541-
<id>generate-docs</id>
542-
<phase>generate-sources</phase>
543-
<goals>
544-
<goal>generate</goal>
545-
</goals>
546-
<configuration>
547-
<inputSpec>${project.basedir}/src/main/resources/api.yaml</inputSpec>
548-
<output>${project.build.directory}/generated-sources</output>
549-
<generatorName>html2</generatorName>
550-
</configuration>
551-
</execution>
552-
</executions>
553-
</plugin>
554-
</plugins>
555-
</build>
556-
557-
<!-- ... -->
558-
```
559-
560404
The following command will generate `index.html` file in the specified output folder that contains API endpoints description.
561405

562406
```bash

boat-engine/pom.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>backbase-openapi-tools</artifactId>
8-
<version>0.16.12-SNAPSHOT</version>
8+
<version>0.17.0-SNAPSHOT</version>
99
</parent>
1010
<artifactId>boat-engine</artifactId>
1111
<packaging>jar</packaging>
@@ -36,17 +36,6 @@
3636
<version>0.3.2</version>
3737
</dependency>
3838

39-
<dependency>
40-
<groupId>org.raml</groupId>
41-
<artifactId>raml-parser-2</artifactId>
42-
<version>1.0.51</version>
43-
<exclusions>
44-
<exclusion>
45-
<groupId>com.github.fge</groupId>
46-
<artifactId>*</artifactId>
47-
</exclusion>
48-
</exclusions>
49-
</dependency>
5039

5140
<dependency>
5241
<groupId>io.swagger.parser.v3</groupId>

boat-engine/src/main/java/com/backbase/oss/boat/DirectoryExploder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
import com.fasterxml.jackson.core.JsonProcessingException;
66
import com.fasterxml.jackson.databind.ObjectWriter;
77
import com.google.common.base.CaseFormat;
8+
import jakarta.validation.constraints.NotNull;
89
import org.apache.commons.io.FileUtils;
910
import org.slf4j.Logger;
1011
import org.slf4j.LoggerFactory;
1112

12-
import javax.validation.constraints.NotNull;
1313
import java.io.File;
1414
import java.io.IOException;
1515
import java.nio.file.Files;

boat-engine/src/main/java/com/backbase/oss/boat/ExampleUtils.java

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

0 commit comments

Comments
 (0)