Skip to content

Commit 0eb8a00

Browse files
authored
Merge pull request #269 from Backbase/release-0.15.7
Release 0.15.7
2 parents 3fb4322 + e685f6c commit 0eb8a00

12 files changed

Lines changed: 35 additions & 25 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ The project is very much Work In Progress and will be published on maven central
1818

1919
# Release Notes
2020
BOAT is still under development and subject to change.
21+
## 0.15.7
22+
* *Boat Scaffold*
23+
* Makes sure to not autogenerate examples from schema if examples are already present
2124
## 0.15.6
2225
* *Maven Plugin*
2326
* Add example of use the additional properties like createApiComponent
24-
* Boat Angular generator
27+
* *Boat Angular generator*
2528
* Generate the `ng-package.json` file for use with the `ng-package` CLI
2629
## 0.15.5
2730
* *Boat Lint*
@@ -41,7 +44,7 @@ BOAT is still under development and subject to change.
4144
* Made `boat:radio` goal properties w.r.t boat-bay server unique.
4245
## 0.15.0
4346
* *Maven Plugin*
44-
* Added new goal `boat:radio`; see the description in the [plugin documentation](boat-maven-plugin/README.md#boatradio).
47+
* Added new goal `boat:radio`; see the description in the [plugin **documentation**](boat-maven-plugin/README.md#boatradio).
4548
## 0.14.12
4649
* *Boat Scaffold*
4750
* References to /examples/foo now are also dereferenced

boat-engine/pom.xml

Lines changed: 1 addition & 1 deletion
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.15.6</version>
8+
<version>0.15.7-SNAPSHOT</version>
99
</parent>
1010
<artifactId>boat-engine</artifactId>
1111
<packaging>jar</packaging>

boat-maven-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
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.15.6</version>
8+
<version>0.15.7-SNAPSHOT</version>
99
</parent>
1010
<artifactId>boat-maven-plugin</artifactId>
1111

boat-quay/boat-quay-lint/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>boat-quay</artifactId>
8-
<version>0.15.6</version>
8+
<version>0.15.7-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>boat-quay-lint</artifactId>
@@ -99,4 +99,4 @@
9999
</plugins>
100100
</build>
101101

102-
</project>
102+
</project>

boat-quay/boat-quay-rules/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>boat-quay</artifactId>
8-
<version>0.15.6</version>
8+
<version>0.15.7-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>boat-quay-rules</artifactId>
@@ -172,4 +172,4 @@
172172
</plugins>
173173
</build>
174174

175-
</project>
175+
</project>

boat-quay/pom.xml

Lines changed: 2 additions & 2 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.15.6</version>
8+
<version>0.15.7-SNAPSHOT</version>
99
</parent>
1010

1111

@@ -29,4 +29,4 @@
2929
<module>boat-quay-lint</module>
3030
</modules>
3131

32-
</project>
32+
</project>

boat-scaffold/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>backbase-openapi-tools</artifactId>
8-
<version>0.15.6</version>
8+
<version>0.15.7-SNAPSHOT</version>
99
</parent>
10-
10+
1111
<artifactId>boat-scaffold</artifactId>
1212

1313
<packaging>jar</packaging>
@@ -87,7 +87,7 @@
8787
<dependency>
8888
<groupId>com.backbase.oss</groupId>
8989
<artifactId>boat-trail-resources</artifactId>
90-
<version>0.15.6</version>
90+
<version>0.15.7-SNAPSHOT</version>
9191
<scope>test</scope>
9292
</dependency>
9393
</dependencies>

boat-scaffold/src/main/java/com/backbase/oss/codegen/doc/BoatExampleUtils.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,21 @@ public static void convertExamples(OpenAPI openAPI, MediaType mediaType, String
5959
}
6060

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

65-
if (openAPI.getComponents().getSchemas() != null && openAPI.getComponents().getSchemas().get(ref) != null && openAPI.getComponents().getSchemas().get(ref).getExample() != null) {
66-
Object example = openAPI.getComponents().getSchemas().get(ref).getExample();
67-
BoatExample boatExample = new BoatExample("example", contentType, new Example().value(example), isJson(contentType));
68-
examples.add(boatExample);
69-
}
65+
ref = StringUtils.substringAfterLast(ref, "/");
66+
67+
boolean hasValidRef = openAPI.getComponents().getSchemas() != null && openAPI.getComponents().getSchemas().get(ref) != null;
68+
69+
if (!hasValidRef) return;
70+
71+
Schema schema = openAPI.getComponents().getSchemas().get(ref);
72+
73+
if (schema.getExample() != null) {
74+
Object example = schema.getExample();
75+
BoatExample boatExample = new BoatExample("example", contentType, new Example().value(example), isJson(contentType));
76+
examples.add(boatExample);
7077
}
7178
}
7279

boat-terminal/pom.xml

Lines changed: 1 addition & 1 deletion
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.15.6</version>
8+
<version>0.15.7-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>boat-terminal</artifactId>

boat-trail-resources/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<parent>
66
<groupId>com.backbase.oss</groupId>
77
<artifactId>backbase-openapi-tools</artifactId>
8-
<version>0.15.6</version>
8+
<version>0.15.7-SNAPSHOT</version>
99
</parent>
10-
10+
1111
<artifactId>boat-trail-resources</artifactId>
1212

1313
<packaging>jar</packaging>

0 commit comments

Comments
 (0)