Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ The project is very much Work In Progress and will be published on maven central

# Release Notes
BOAT is still under development and subject to change.
## 0.15.7
* *Boat Scaffold*
* Makes sure to not autogenerate examples from schema if examples are already present
## 0.15.6
* *Maven Plugin*
* Add example of use the additional properties like createApiComponent
* Boat Angular generator
* *Boat Angular generator*
* Generate the `ng-package.json` file for use with the `ng-package` CLI
## 0.15.5
* *Boat Lint*
Expand All @@ -41,7 +44,7 @@ BOAT is still under development and subject to change.
* Made `boat:radio` goal properties w.r.t boat-bay server unique.
## 0.15.0
* *Maven Plugin*
* Added new goal `boat:radio`; see the description in the [plugin documentation](boat-maven-plugin/README.md#boatradio).
* Added new goal `boat:radio`; see the description in the [plugin **documentation**](boat-maven-plugin/README.md#boatradio).
## 0.14.12
* *Boat Scaffold*
* References to /examples/foo now are also dereferenced
Expand Down
2 changes: 1 addition & 1 deletion 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.15.6</version>
<version>0.15.7-SNAPSHOT</version>
</parent>
<artifactId>boat-engine</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion boat-maven-plugin/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.15.6</version>
<version>0.15.7-SNAPSHOT</version>
</parent>
<artifactId>boat-maven-plugin</artifactId>

Expand Down
4 changes: 2 additions & 2 deletions boat-quay/boat-quay-lint/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>boat-quay</artifactId>
<version>0.15.6</version>
<version>0.15.7-SNAPSHOT</version>
</parent>

<artifactId>boat-quay-lint</artifactId>
Expand Down Expand Up @@ -99,4 +99,4 @@
</plugins>
</build>

</project>
</project>
4 changes: 2 additions & 2 deletions boat-quay/boat-quay-rules/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>boat-quay</artifactId>
<version>0.15.6</version>
<version>0.15.7-SNAPSHOT</version>
</parent>

<artifactId>boat-quay-rules</artifactId>
Expand Down Expand Up @@ -172,4 +172,4 @@
</plugins>
</build>

</project>
</project>
4 changes: 2 additions & 2 deletions boat-quay/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.15.6</version>
<version>0.15.7-SNAPSHOT</version>
</parent>


Expand All @@ -29,4 +29,4 @@
<module>boat-quay-lint</module>
</modules>

</project>
</project>
6 changes: 3 additions & 3 deletions boat-scaffold/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.15.6</version>
<version>0.15.7-SNAPSHOT</version>
</parent>

<artifactId>boat-scaffold</artifactId>

<packaging>jar</packaging>
Expand Down Expand Up @@ -87,7 +87,7 @@
<dependency>
<groupId>com.backbase.oss</groupId>
<artifactId>boat-trail-resources</artifactId>
<version>0.15.6</version>
<version>0.15.7-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,21 @@ public static void convertExamples(OpenAPI openAPI, MediaType mediaType, String
}

private static void processRef(OpenAPI openAPI, String contentType, List<BoatExample> examples, String ref) {
if (ref.startsWith("#/components/schemas")) {
ref = StringUtils.substringAfterLast(ref, "/");
if (!examples.isEmpty()) return; // No auto-generated example from the schema if examples are already present.
if (!ref.startsWith("#/components/schemas")) return;

if (openAPI.getComponents().getSchemas() != null && openAPI.getComponents().getSchemas().get(ref) != null && openAPI.getComponents().getSchemas().get(ref).getExample() != null) {
Object example = openAPI.getComponents().getSchemas().get(ref).getExample();
BoatExample boatExample = new BoatExample("example", contentType, new Example().value(example), isJson(contentType));
examples.add(boatExample);
}
ref = StringUtils.substringAfterLast(ref, "/");

boolean hasValidRef = openAPI.getComponents().getSchemas() != null && openAPI.getComponents().getSchemas().get(ref) != null;

if (!hasValidRef) return;

Schema schema = openAPI.getComponents().getSchemas().get(ref);

if (schema.getExample() != null) {
Object example = schema.getExample();
BoatExample boatExample = new BoatExample("example", contentType, new Example().value(example), isJson(contentType));
examples.add(boatExample);
}
}

Expand Down
2 changes: 1 addition & 1 deletion boat-terminal/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.15.6</version>
<version>0.15.7-SNAPSHOT</version>
</parent>

<artifactId>boat-terminal</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions boat-trail-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<parent>
<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.15.6</version>
<version>0.15.7-SNAPSHOT</version>
</parent>

<artifactId>boat-trail-resources</artifactId>

<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.backbase.oss</groupId>
<artifactId>backbase-openapi-tools</artifactId>
<version>0.15.6</version>
<version>0.15.7-SNAPSHOT</version>

<packaging>pom</packaging>
<description>Backbase Open Api Tools will help you converting RAML to OpenAPI plus many more</description>
Expand Down
2 changes: 1 addition & 1 deletion tests/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.15.6</version>
<version>0.15.7-SNAPSHOT</version>
</parent>

<artifactId>tests</artifactId>
Expand Down