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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

### Dependencies
- Updated dependencies:

Compile:
* Bump jsonschema2pojo version from 1.2.2 to 1.3.3

### Bug fixes

- Remove the root-level `logback.xml` from the `tarantool-core` runtime JAR.
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
<shared.dir>${project.parent.basedir}/tarantool-shared-resources/</shared.dir>
<license.header.file>${project.basedir}/LICENSE_HEADER.txt</license.header.file>
<maven-surefire-plugin.version>3.5.5</maven-surefire-plugin.version>
<jsonschema2pojo.version>1.2.2</jsonschema2pojo.version>
</properties>

<build>
Expand Down
8 changes: 7 additions & 1 deletion tarantool-java-sdk-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<commons-codec.version>1.22.0</commons-codec.version>
<commons-io.version>2.21.0</commons-io.version>
<instancio.version>5.5.1</instancio.version>
<jsonschema2pojo.version>1.2.2</jsonschema2pojo.version>
<jsonschema2pojo.version>1.3.3</jsonschema2pojo.version>
<opentelemetry.version>1.62.0</opentelemetry.version>
</properties>

Expand Down Expand Up @@ -205,6 +205,12 @@
<version>${jsonschema2pojo.version}</version>
</dependency>

<dependency>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>${jsonschema2pojo.version}</version>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
1 change: 0 additions & 1 deletion testcontainers-autogen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<dependency>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-core</artifactId>
<version>${jsonschema2pojo.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
import java.util.Map;
import java.util.Set;

import static org.apache.commons.lang.StringUtils.substringAfter;
import static org.apache.commons.lang.StringUtils.substringBefore;
import static org.jsonschema2pojo.rules.PrimitiveTypes.isPrimitive;
import static org.jsonschema2pojo.rules.PrimitiveTypes.primitiveType;
import static org.jsonschema2pojo.util.TypeUtil.resolveType;
import com.fasterxml.jackson.databind.JsonNode;
import com.sun.codemodel.ClassType;
import com.sun.codemodel.JBlock;
Expand All @@ -34,18 +29,21 @@
import com.sun.codemodel.JPackage;
import com.sun.codemodel.JType;
import com.sun.codemodel.JVar;
import org.apache.commons.lang3.StringUtils;
import org.jsonschema2pojo.AnnotationStyle;
import org.jsonschema2pojo.Annotator;
import org.jsonschema2pojo.Schema;
import org.jsonschema2pojo.exception.ClassAlreadyExistsException;
import org.jsonschema2pojo.exception.GenerationException;
import org.jsonschema2pojo.rules.ObjectRule;
import org.jsonschema2pojo.rules.PrimitiveTypes;
import org.jsonschema2pojo.rules.Rule;
import org.jsonschema2pojo.rules.RuleFactory;
import org.jsonschema2pojo.util.AnnotationHelper;
import org.jsonschema2pojo.util.ParcelableHelper;
import org.jsonschema2pojo.util.ReflectionHelper;
import org.jsonschema2pojo.util.SerializableHelper;
import org.jsonschema2pojo.util.TypeUtil;

public class SeparatedPackageObjectRule extends ObjectRule {

Expand Down Expand Up @@ -194,18 +192,20 @@

try {
if (node.has("existingJavaType")) {
String fqn = substringBefore(node.get("existingJavaType").asText(), "<");
String fqn = StringUtils.substringBefore(node.get("existingJavaType").asText(), "<");

if (isPrimitive(fqn, _package.owner())) {
throw new ClassAlreadyExistsException(primitiveType(fqn, _package.owner()));
if (PrimitiveTypes.isPrimitive(fqn, _package.owner())) {
throw new ClassAlreadyExistsException(
PrimitiveTypes.primitiveType(fqn, _package.owner()));
}

JClass existingClass =
resolveType(
TypeUtil.resolveType(
_package,
fqn
+ (node.get("existingJavaType").asText().contains("<")
? "<" + substringAfter(node.get("existingJavaType").asText(), "<")
? "<"
+ StringUtils.substringAfter(node.get("existingJavaType").asText(), "<")
: ""));
throw new ClassAlreadyExistsException(existingClass);
}
Expand All @@ -215,7 +215,7 @@
if (node.has("javaType")) {
String fqn = node.path("javaType").asText();

if (isPrimitive(fqn, _package.owner())) {
if (PrimitiveTypes.isPrimitive(fqn, _package.owner())) {
throw new GenerationException(
"javaType cannot refer to a primitive type ("
+ fqn
Expand Down Expand Up @@ -491,7 +491,7 @@
}
}

for (Iterator<Map.Entry<String, JsonNode>> iterator = properties.fields();

Check warning on line 494 in testcontainers-autogen/src/main/java/io/tarantool/SeparatedPackageObjectRule.java

View workflow job for this annotation

GitHub Actions / tests-box-integration (2.11.8-ubuntu20.04)

[deprecation] fields() in JsonNode has been deprecated
iterator.hasNext(); ) {
Map.Entry<String, JsonNode> entry = iterator.next();
String propertyName = entry.getKey();
Expand Down Expand Up @@ -590,7 +590,7 @@

private void addInterfaces(JDefinedClass jclass, JsonNode javaInterfaces) {
for (JsonNode i : javaInterfaces) {
jclass._implements(resolveType(jclass._package(), i.asText()));
jclass._implements(TypeUtil.resolveType(jclass._package(), i.asText()));
}
}

Expand Down
1 change: 0 additions & 1 deletion testcontainers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>${jsonschema2pojo.version}</version>
<configuration>
<sourceDirectory>${basedir}/src/main/resources/tarantool</sourceDirectory>
<targetPackage>io.tarantool.autogen</targetPackage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@

import io.tarantool.autogen.Tarantool3Configuration;
import io.tarantool.autogen.credentials.Credentials;
import io.tarantool.autogen.credentials.roles.rolesProperty.privilege.Permission;
import io.tarantool.autogen.credentials.roles.rolesProperty.privilege.Privilege;
import io.tarantool.autogen.credentials.users.Users;
import io.tarantool.autogen.credentials.users.usersProperty.UsersProperty;
import io.tarantool.autogen.groups.Groups;
Expand Down Expand Up @@ -293,13 +291,41 @@ private static Path createConfig(String containerName, Integer... exposedPorts)
.withPassword("secret_a")
.withPrivileges(
List.of(
Privilege.builder()
io.tarantool
.autogen
.credentials
.users
.usersProperty
.privilege
.Privilege
.builder()
.withPermissions(
new LinkedHashSet<>(
List.of(
Permission.READ,
Permission.WRITE,
Permission.EXECUTE)))
io.tarantool
.autogen
.credentials
.users
.usersProperty
.privilege
.Permission
.READ,
io.tarantool
.autogen
.credentials
.users
.usersProperty
.privilege
.Permission
.WRITE,
io.tarantool
.autogen
.credentials
.users
.usersProperty
.privilege
.Permission
.EXECUTE)))
.build()))
.build())
.withAdditionalProperty(
Expand All @@ -308,13 +334,41 @@ private static Path createConfig(String containerName, Integer... exposedPorts)
.withPassword("secret_b")
.withPrivileges(
List.of(
Privilege.builder()
io.tarantool
.autogen
.credentials
.users
.usersProperty
.privilege
.Privilege
.builder()
.withPermissions(
new LinkedHashSet<>(
List.of(
Permission.READ,
Permission.WRITE,
Permission.EXECUTE)))
io.tarantool
.autogen
.credentials
.users
.usersProperty
.privilege
.Permission
.READ,
io.tarantool
.autogen
.credentials
.users
.usersProperty
.privilege
.Permission
.WRITE,
io.tarantool
.autogen
.credentials
.users
.usersProperty
.privilege
.Permission
.EXECUTE)))
.build()))
.build())
.withAdditionalProperty(
Expand All @@ -325,10 +379,25 @@ private static Path createConfig(String containerName, Integer... exposedPorts)
.withPassword("secret_d")
.withPrivileges(
Collections.singletonList(
Privilege.builder()
io.tarantool
.autogen
.credentials
.users
.usersProperty
.privilege
.Privilege
.builder()
.withPermissions(
new LinkedHashSet<>(
Collections.singletonList(Permission.EXECUTE)))
Collections.singletonList(
io.tarantool
.autogen
.credentials
.users
.usersProperty
.privilege
.Permission
.EXECUTE)))
.build()))
.build())
.withAdditionalProperty(
Expand Down
Loading