Skip to content
Open
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ It currently consists of
# Release Notes
BOAT is still under development and subject to change.

## 0.18.1
* Use Jackson3 imports in `BigDecimalCustomSerializer.class` when using `useJackson3` set to `true`

## 0.18.0
* openapi-generator `7.20.0` baseline (Spring Boot 4, Jackson 3)
* moved Java and JavaSpring templates to `7.20.0` adding remaing custom features
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.18.0-SNAPSHOT</version>
<version>0.18.1-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.18.0-SNAPSHOT</version>
<version>0.18.1-SNAPSHOT</version>
</parent>
<artifactId>boat-maven-plugin</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion 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.18.0-SNAPSHOT</version>
<version>0.18.1-SNAPSHOT</version>
</parent>

<artifactId>boat-quay-lint</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion 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.18.0-SNAPSHOT</version>
<version>0.18.1-SNAPSHOT</version>
</parent>

<artifactId>boat-quay-rules</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion 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.18.0-SNAPSHOT</version>
<version>0.18.1-SNAPSHOT</version>
</parent>


Expand Down
4 changes: 2 additions & 2 deletions boat-scaffold/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.18.0-SNAPSHOT</version>
<version>0.18.1-SNAPSHOT</version>
</parent>

<artifactId>boat-scaffold</artifactId>
Expand Down Expand Up @@ -102,7 +102,7 @@
<dependency>
<groupId>com.backbase.oss</groupId>
<artifactId>boat-trail-resources</artifactId>
<version>0.18.0-SNAPSHOT</version>
<version>0.18.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class BoatSpringCodeGen extends SpringCodegen {
public static final String ADD_BINDING_RESULT = "addBindingResult";

private static final String VENDOR_EXTENSION_NOT_NULL = "x-not-null";
private static final String JSON_SERIALIZE = "JsonSerialize";

static class NewLineIndent implements Mustache.Lambda {

Expand Down Expand Up @@ -206,8 +207,8 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo
}

/**
* "overridden" to fix invalid code when the data type is a collection of a fully qualified classname.
* eg. <code>Set<@Valid com.backbase.dbs.arrangement.commons.model.TranslationItemDto></code>
* "overridden" to fix invalid code when the data type is a collection of a fully qualified classname. eg. <code>Set<@Valid
* com.backbase.dbs.arrangement.commons.model.TranslationItemDto></code>
*
* @param itemsProperty
* @param dataType
Expand Down Expand Up @@ -314,7 +315,12 @@ public void processOpts() {
serializerTemplate + ".java"
));
this.importMapping.put(serializerTemplate, modelPackage + "." + serializerTemplate);
this.importMapping.put("JsonSerialize", "com.fasterxml.jackson.databind.annotation.JsonSerialize");

if (this.additionalProperties.containsKey(USE_JACKSON_3)) {
this.importMapping.put(JSON_SERIALIZE, "tools.jackson.databind.annotation.JsonSerialize");
} else {
this.importMapping.put(JSON_SERIALIZE, "com.fasterxml.jackson.databind.annotation.JsonSerialize");
}

if (this.additionalProperties.containsKey(ADD_SERVLET_REQUEST)) {
this.addServletRequest = convertPropertyToBoolean(ADD_SERVLET_REQUEST);
Expand Down Expand Up @@ -386,7 +392,7 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert
if (shouldSerializeBigDecimalAsString(property)) {
property.vendorExtensions.put("x-extra-annotation", "@JsonSerialize(using = BigDecimalCustomSerializer.class)");
model.imports.add("BigDecimalCustomSerializer");
model.imports.add("JsonSerialize");
model.imports.add(JSON_SERIALIZE);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package {{modelPackage}};

import com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase;
{{#useJackson3}}
import tools.jackson.databind.ser.std.ToStringSerializerBase;
{{/useJackson3}}
{{^useJackson3}}
import com.fasterxml.jackson.databind.ser.std.ToStringSerializerBase;
{{/useJackson3}}
import java.math.BigDecimal;

public class BigDecimalCustomSerializer extends ToStringSerializerBase {
Expand Down
2 changes: 1 addition & 1 deletion boat-trail-resources/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.18.0-SNAPSHOT</version>
<version>0.18.1-SNAPSHOT</version>
</parent>

<artifactId>boat-trail-resources</artifactId>
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.18.0-SNAPSHOT</version>
<version>0.18.1-SNAPSHOT</version>

<packaging>pom</packaging>
<description>Backbase Open Api Tools is a collection of tools to work with Open API</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.18.0-SNAPSHOT</version>
<version>0.18.1-SNAPSHOT</version>
</parent>

<artifactId>tests</artifactId>
Expand Down