Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
a0bde2f
Remove multiple tags on boat angular
bartv-bb Aug 22, 2022
6478e8d
Bump openapi-generator.version from 4.3.1 to 6.2.1
dependabot[bot] Nov 10, 2022
76c48bb
Merge remote-tracking branch 'origin/main'
bartv-bb Nov 10, 2022
249f5d0
Removed RAML support
bartv-bb Nov 10, 2022
75e44d0
Removed RAML Export mojos
bartv-bb Nov 10, 2022
7fe618e
Merge branch 'main' into dependabot/maven/openapi-generator.version-6…
bartv-bb Nov 10, 2022
e0305f3
Made it compile
bartv-bb Nov 10, 2022
1947b1c
Bump openapi-generator.version from 4.3.1 to 6.2.1
dependabot[bot] Nov 10, 2022
6b140f4
Remove multiple tags on boat angular
bartv-bb Aug 22, 2022
9740e9c
Removed RAML support
bartv-bb Nov 10, 2022
755cc81
Removed RAML Export mojos
bartv-bb Nov 10, 2022
ddcd278
Made it compile
bartv-bb Nov 10, 2022
1fc83f7
Some more fixes!
bartv-bb Nov 11, 2022
f289ec1
Merge remote-tracking branch 'origin/dependabot/maven/openapi-generat…
bartv-bb Nov 11, 2022
cb44fcc
Fixed marcos' stuff
bartv-bb Nov 11, 2022
65d5848
Fixed marcos' stuff
bartv-bb Nov 11, 2022
f4cf4bc
Fix some more tests
santam85 Nov 29, 2022
cba5b5d
Bump openapi-generator.version from 4.3.1 to 6.2.1
dependabot[bot] Nov 10, 2022
aae00f7
Remove multiple tags on boat angular
bartv-bb Aug 22, 2022
a0c4034
Removed RAML support
bartv-bb Nov 10, 2022
13b000b
Removed RAML Export mojos
bartv-bb Nov 10, 2022
f9d4859
Made it compile
bartv-bb Nov 10, 2022
4b32b59
Some more fixes!
bartv-bb Nov 11, 2022
6f25609
Remove multiple tags on boat angular
bartv-bb Aug 22, 2022
bf1b5dc
Removed RAML support
bartv-bb Nov 10, 2022
d7655f0
Made it compile
bartv-bb Nov 10, 2022
299c675
Fixed marcos' stuff
bartv-bb Nov 11, 2022
1068973
Fixed marcos' stuff
bartv-bb Nov 11, 2022
a81fe63
Fix some more tests
santam85 Nov 29, 2022
0ee0f32
Fix boat marina test
santam85 Nov 30, 2022
f3f820c
Update to Java 18
santam85 Nov 30, 2022
a910a76
Update to Java 17
santam85 Nov 30, 2022
540821f
Fix rebase mistake
santam85 Nov 30, 2022
344336b
Added missing dependency for plugin
santam85 Nov 30, 2022
8d4b44a
update OpenAPI Tools to version 6.2.1
miladbb Dec 21, 2022
8280298
Merge branch 'main' of github.com:Backbase/backbase-openapi-tools int…
miladbb Dec 21, 2022
729f932
Merge remote-tracking branch 'origin/dependabot/maven/openapi-generat…
bartv-bb Dec 21, 2022
0c65c89
Merge branch 'dependabot/maven/openapi-generator.version-6.2.1' into …
miladbb Dec 21, 2022
7d0c9f2
Include Jakarta dependency in pom.mustache for spring boot
bartv-bb Dec 21, 2022
ca40283
Added Generated Application to generated files
bartv-bb Dec 21, 2022
8802717
Fixed isNullable in templates
bartv-bb Dec 22, 2022
a59f8ba
Fixed more stuff
bartv-bb Dec 22, 2022
9f13481
Getting closer
bartv-bb Dec 22, 2022
05acd78
fix spring model exception, bump swagger-parser
miladbb Dec 22, 2022
4b923aa
Added missing gradle wrapper
bartv-bb Dec 23, 2022
9e3a6e5
Restored BoatCodegenParameter to it's verbose glory
bartv-bb Dec 23, 2022
69f5f57
Added missing supporting files
bartv-bb Dec 23, 2022
f84153a
Added way to much dependencies but it completes the build. Next up, D…
bartv-bb Dec 23, 2022
30514b8
remove unnecessary persistence imports
miladbb Dec 23, 2022
5802596
add useJakartaEe for java
miladbb Dec 23, 2022
927a179
feat: add qualifier for inter service rest template
miladbb Jan 3, 2023
28df75f
Removed documentation to RAML exporters
bartv-bb Jan 9, 2023
7a11e1f
Restored integration test resources
bartv-bb Jan 9, 2023
7450675
Merge remote-tracking branch 'origin/test-merge' into test-merge
bartv-bb Jan 9, 2023
052078f
feat: remove fixed true value of useJakartaEe in spring
miladbb Jan 10, 2023
c98fc4d
feat: add useSpringBoot3 by default for spring-embedded
miladbb Jan 10, 2023
68581cb
feat: change Nonnull annotation in java
miladbb Jan 11, 2023
744bcf9
Replace usages of hasMore in api.service.mustache with -last, as hasM…
arundathiBB Jan 17, 2023
3121c39
fix: use typeMapping for replacing set by list
miladbb Jan 19, 2023
7972af5
Merge remote-tracking branch 'origin/test-merge' into test-merge
miladbb Jan 19, 2023
1494253
fix sonar issue by adding some tests
miladbb Jan 19, 2023
c6778a0
feat: add openapi-normalizer to fix the inheritance issue
miladbb Jan 23, 2023
5876078
fix: addServletRequest error when the endpoint does not have any para…
miladbb Jan 30, 2023
cfcb1c0
fix: addServletRequest error when the endpoint does not have any para…
miladbb Jan 30, 2023
8cf03d8
Merge branch 'main' into test-merge
miladbb Jan 30, 2023
47a39a5
Merge branch 'main' into test-merge
santam85 Jan 31, 2023
fcd0154
Update snapshot publishing
santam85 Jan 31, 2023
dc856f7
Remove need for gpg on sonar task
santam85 Jan 31, 2023
3848d20
Skip gpg on sonar
santam85 Jan 31, 2023
4f94e37
Upgraded dependencies. Removed obsolete dependencies. Improved style …
bartv-bb Jan 31, 2023
73f9ead
Merge branch 'feature/normalizer-6-3-0' into test-merge
miladbb Feb 2, 2023
d6f7480
Merge branch 'test-merge' of github.com:Backbase/backbase-openapi-too…
miladbb Feb 2, 2023
08eda59
bump openapi generator to stable version 6.3.0
miladbb Feb 2, 2023
525c191
update templates based on version 6.3.0
miladbb Feb 3, 2023
15a2862
set openapiNormalizer REF_AS_PARENT_IN_ALLOF true as default
miladbb Feb 3, 2023
b5f3b86
Merge branch 'main' of github.com:Backbase/backbase-openapi-tools int…
miladbb Feb 6, 2023
1a44ff0
Merge branch 'main' of github.com:Backbase/backbase-openapi-tools int…
miladbb Feb 7, 2023
a116628
bump angular version in it test
miladbb Feb 17, 2023
3fa1097
add schemaMapping
miladbb Feb 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 34 additions & 2 deletions .github/workflows/boat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: '11'
java-version: '17'
cache: 'maven'
- name: Build & Test
run: mvn -B test
Expand All @@ -31,10 +31,42 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: '11'
java-version: '17'
cache: 'maven'
- name: Build and Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify sonar:sonar -Dgpg.skip
publish:
if: "!contains(github.event.head_commit.message, '[version bump]')"
runs-on: ubuntu-latest
needs: [ test, sonar ]
steps:
- name: Checkout project
uses: actions/checkout@v3

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: '17'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Build and Publish SNAPSHOT
run: |
mvn \
--no-transfer-progress \
--batch-mode \
-DskipTests=true \
deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: '11'
java-version: '17'
cache: 'maven'
- name: Build & Test
run: mvn -B test
Expand All @@ -31,7 +31,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: '11'
java-version: '17'
cache: 'maven'
- name: Build and Analyze
env:
Expand All @@ -51,7 +51,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: '11'
java-version: '17'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: '11'
java-version: '17'
cache: 'maven'
- name: Configure Git user
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ hs_err_pid*
.*
# but not git dot files (e.g. .gitattribute)
!.git?*

!boat-scaffold/src/main/templates/boat-java/gradle-wrapper.jar
176 changes: 10 additions & 166 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,26 @@ The Backbase Open API Tools is a collection of tools created to work efficiently

It currently consists of

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

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

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

## 0.17.0
* General
* Removed RAML Support
* Update OpenAPI Tools to 6.2.1
* Boat Java Generator
* Jakarta EE 9 compatibility
* `spring-mvc` library is removed because it is not supported by OpenAPI Tools anymore
* Use of `Set` for unique items is now enabled by default as OpenAPI Generator fixed their implementation

## 0.16.11
* Boat Angular generator
* Set `removeComments: false` in generated tsconfig.json files to retain `/*#__PURE__*/` annotation in compiled JS.
Expand Down Expand Up @@ -391,172 +399,8 @@ BOAT is still under development and subject to change.
mvn install
```

## CLI Usage

### Convert RAML to Open API 3.0
```shell script
cd boat-terminal
java -jar target/boat-terminal-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
-f src/test/resources/api.raml
```


### Convert RAML to Open API 3.0 && Pipe output to file
```shell script
cd boat-terminal
java -jar target/boat-terminal-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
-f src/test/resources/api.raml \
> openapi.yaml
```


### Convert RAML to Open API 3.0 file and verbose logging
```shell script
cd boat-terminal
java -jar target/boat-terminal-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
-f src/test/resources/api.raml \
-o swagger.yaml \
-v
```

### Convert RAML to Open API 3.0 with examples exploded into <output-dir>/examples/
```shell script
cd boat-terminal
java -jar target/boat-terminal-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
-f src/test/resources/api.raml \
-o swagger.yaml \
-d my-open-api-spec/ \
-v
```


## Maven Plugin Usage

Configuration

```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>my.project</groupId>
<artifactId>my-specs-definition</artifactId>
<version>1.0</version>
<packaging>pom</packaging>

<properties>
<boat-maven-plugin.version>0.1.4</boat-maven-plugin.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>com.backbase.oss</groupId>
<artifactId>boat-maven-plugin</artifactId>
<version>${boat-maven-plugin.version}</version>
<executions>
<execution>
<id>export-raml-spec</id>
<phase>generate-sources</phase>
<goals>
<goal>export</goal>
</goals>
<configuration>
<inputFile>${basedir}/src/main/resources/client-api.raml</inputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
```

The following command will convert the given `client-api.raml` file into Open API 3.0 format.

```bash
mvn boat:export
```

**NOTE:** RAML file name should end with `-api.raml`, `service-api.raml` or `client-api.raml`.

## Export All Specifications in Bill-Of-Materials pom file
If you want to export all specifications referenced in a pom file, you can use the following mojo

```xml
<build>
<plugins>
<plugin>
<groupId>com.backbase.boat</groupId>
<artifactId>boat-maven-plugin</artifactId>
<version>${boat-maven-plugin.version}</version>
<configuration>
<specBom>
<groupId>com.backbase.dbs</groupId>-->
<artifactId>banking-services-bom</artifactId>
<version>[2.16.0,)</version>
<type>pom</type>
<!-- Bom equal or higher than 2.16 -->
</specBom>
<output>${project.basedir}/raml-2-openapi-specs</output>
<xLogoUrl>http://www.backbase.com/wp-content/uploads/2017/04/backbase-logo-png.png</xLogoUrl>
<xLogoAltText>Backbase</xLogoAltText>
<markdownBottom># Disclaimer
This API is converted from RAML1.0 using the boat-maven-plugin and is not final or validated!
</markdownBottom>
<addChangeLog>true</addChangeLog>
</configuration>
</plugin>
</plugins>
</build>

```

### Configuration Options

* The `addChangeLog` option will automagically insert a change log between all referenced versions
* 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+)$`

```bash
mvn boat:export-bom
```

## Generate API docs

Configuration

```xml
<!-- ... -->

<build>
<plugins>
<plugin>
<groupId>com.backbase.oss</groupId>
<artifactId>boat-maven-plugin</artifactId>
<version>${boat-maven-plugin.version}</version>
<executions>
<execution>
<id>generate-docs</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/api.yaml</inputSpec>
<output>${project.build.directory}/generated-sources</output>
<generatorName>html2</generatorName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<!-- ... -->
```

The following command will generate `index.html` file in the specified output folder that contains API endpoints description.

```bash
Expand Down
13 changes: 1 addition & 12 deletions boat-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.16.12-SNAPSHOT</version>
<version>0.17.0-SNAPSHOT</version>
</parent>
<artifactId>boat-engine</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -36,17 +36,6 @@
<version>0.3.2</version>
</dependency>

<dependency>
<groupId>org.raml</groupId>
<artifactId>raml-parser-2</artifactId>
<version>1.0.51</version>
<exclusions>
<exclusion>
<groupId>com.github.fge</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.swagger.parser.v3</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.google.common.base.CaseFormat;
import jakarta.validation.constraints.NotNull;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.validation.constraints.NotNull;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
Expand Down
55 changes: 0 additions & 55 deletions boat-engine/src/main/java/com/backbase/oss/boat/ExampleUtils.java

This file was deleted.

Loading