Skip to content

Commit

Permalink
Use the new @JsonGen annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Nov 30, 2023
1 parent 844f0b6 commit 9cbff3e
Show file tree
Hide file tree
Showing 28 changed files with 271 additions and 45 deletions.
190 changes: 190 additions & 0 deletions vertx-web-api-contract/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<?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/maven-v4_0_0.xsd">
<parent>
<artifactId>vertx-web-parent</artifactId>
<groupId>io.vertx</groupId>
<version>4.5.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>vertx-web-api-contract</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>org.yaml:*</include>
<include>com.fasterxml.jackson.dataformat:jackson-dataformat-yaml</include>
<include>io.swagger.parser.v3:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>io.swagger.v3.parser</pattern>
<shadedPattern>io.vertx.ext.web.api.io.swagger.v3.parser</shadedPattern>
</relocation>
<relocation>
<pattern>org.yaml.snakeyaml</pattern>
<shadedPattern>io.vertx.ext.web.api.org.yaml.snakeyaml</shadedPattern>
</relocation>
<relocation>
<pattern>com.fasterxml.jackson.dataformat.yaml</pattern>
<shadedPattern>io.vertx.ext.web.api.fasterxml.jackson.dataformat.yaml</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>4.5.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator</artifactId>
<version>1.0.43</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-auth-jwt</artifactId>
<version>4.5.1-SNAPSHOT</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
<version>4.5.1-SNAPSHOT</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web-client</artifactId>
<version>4.5.1-SNAPSHOT</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>vertx-uri-template</artifactId>
<groupId>io.vertx</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-unit</artifactId>
<version>4.5.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-auth-properties</artifactId>
<version>4.5.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-service-proxy</artifactId>
<version>4.5.1-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>4.5.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-codegen</artifactId>
<version>4.5.1-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-docgen</artifactId>
<version>0.9.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>4.5.1-SNAPSHOT</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.17.5</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>commons-compress</artifactId>
<groupId>org.apache.commons</groupId>
</exclusion>
<exclusion>
<artifactId>duct-tape</artifactId>
<groupId>org.rnorth.duct-tape</groupId>
</exclusion>
<exclusion>
<artifactId>docker-java-api</artifactId>
<groupId>com.github.docker-java</groupId>
</exclusion>
<exclusion>
<artifactId>docker-java-transport-zerodep</artifactId>
<groupId>com.github.docker-java</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<properties>
<doc.skip>false</doc.skip>
</properties>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.vertx.codegen.annotations.DataObject;
import io.vertx.codegen.annotations.Fluent;
import io.vertx.codegen.annotations.JsonGen;
import io.vertx.core.MultiMap;
import io.vertx.core.http.HttpHeaders;
import io.vertx.core.json.JsonObject;
Expand All @@ -12,7 +13,8 @@
/**
* @deprecated You should use the new module vertx-web-openapi
*/
@DataObject(generateConverter = true, publicConverter = false)
@DataObject
@JsonGen(publicConverter = false)
@Deprecated
public class OperationRequest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.vertx.codegen.annotations.DataObject;
import io.vertx.codegen.annotations.Fluent;
import io.vertx.codegen.annotations.JsonGen;
import io.vertx.core.MultiMap;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.HttpHeaders;
Expand All @@ -13,7 +14,8 @@
/**
* @deprecated You should use the new module vertx-web-openapi
*/
@DataObject(generateConverter = true, publicConverter = false)
@DataObject
@JsonGen(publicConverter = false)
@Deprecated
public class OperationResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import io.vertx.codegen.annotations.DataObject;
import io.vertx.codegen.annotations.Fluent;
import io.vertx.codegen.annotations.JsonGen;
import io.vertx.core.Handler;
import io.vertx.core.json.JsonObject;

/**
* @author Francesco Guardiani @slinkydeveloper
* @deprecated You should use the new module vertx-web-openapi
*/
@DataObject(generateConverter = true, publicConverter = false)
@DataObject
@JsonGen(publicConverter = false)
@Deprecated
public class RouterFactoryOptions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.vertx.codegen.annotations.DataObject;
import io.vertx.codegen.annotations.Fluent;
import io.vertx.codegen.annotations.JsonGen;
import io.vertx.core.MultiMap;
import io.vertx.core.http.HttpHeaders;
import io.vertx.core.json.JsonObject;
Expand All @@ -12,7 +13,8 @@
/**
* Data object that encapsulates all informations about an HTTP Request
*/
@DataObject(generateConverter = true, publicConverter = false)
@DataObject
@JsonGen(publicConverter = false)
public class ServiceRequest {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.netty.handler.codec.http.HttpResponseStatus;
import io.vertx.codegen.annotations.DataObject;
import io.vertx.codegen.annotations.Fluent;
import io.vertx.codegen.annotations.JsonGen;
import io.vertx.core.MultiMap;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.HttpHeaders;
Expand All @@ -14,7 +15,8 @@
/**
* Data object that encapsulates all informations about an HTTP Response
*/
@DataObject(generateConverter = true, publicConverter = false)
@DataObject
@JsonGen(publicConverter = false)
public class ServiceResponse {

private final static Integer DEFAULT_STATUS_CODE = 200;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import io.vertx.codegen.annotations.DataObject;
import io.vertx.codegen.annotations.Fluent;
import io.vertx.codegen.annotations.JsonGen;
import io.vertx.core.json.JsonObject;

import java.util.ArrayList;
import java.util.List;

@DataObject(generateConverter = true)
@DataObject
@JsonGen(publicConverter = false)
public class FilterData {

private List<String> from;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class CachingWebClientOptionsConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, CachingWebClientOptions obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, CachingWebClientOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "cachedMethods":
Expand Down Expand Up @@ -51,11 +51,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(CachingWebClientOptions obj, JsonObject json) {
static void toJson(CachingWebClientOptions obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(CachingWebClientOptions obj, java.util.Map<String, Object> json) {
static void toJson(CachingWebClientOptions obj, java.util.Map<String, Object> json) {
if (obj.getCachedMethods() != null) {
JsonArray array = new JsonArray();
obj.getCachedMethods().forEach(item -> array.add(item.toJson()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class OAuth2WebClientOptionsConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, OAuth2WebClientOptions obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, OAuth2WebClientOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "leeway":
Expand All @@ -34,11 +34,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(OAuth2WebClientOptions obj, JsonObject json) {
static void toJson(OAuth2WebClientOptions obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(OAuth2WebClientOptions obj, java.util.Map<String, Object> json) {
static void toJson(OAuth2WebClientOptions obj, java.util.Map<String, Object> json) {
json.put("leeway", obj.getLeeway());
json.put("renewTokenOnForbidden", obj.isRenewTokenOnForbidden());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class WebClientOptionsConverter {
private static final Base64.Decoder BASE64_DECODER = JsonUtil.BASE64_DECODER;
private static final Base64.Encoder BASE64_ENCODER = JsonUtil.BASE64_ENCODER;

public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, WebClientOptions obj) {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, WebClientOptions obj) {
for (java.util.Map.Entry<String, Object> member : json) {
switch (member.getKey()) {
case "followRedirects":
Expand All @@ -44,11 +44,11 @@ public static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json,
}
}

public static void toJson(WebClientOptions obj, JsonObject json) {
static void toJson(WebClientOptions obj, JsonObject json) {
toJson(obj, json.getMap());
}

public static void toJson(WebClientOptions obj, java.util.Map<String, Object> json) {
static void toJson(WebClientOptions obj, java.util.Map<String, Object> json) {
json.put("followRedirects", obj.isFollowRedirects());
if (obj.getTemplateExpandOptions() != null) {
json.put("templateExpandOptions", obj.getTemplateExpandOptions().toJson());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package io.vertx.ext.web.client;

import io.vertx.codegen.annotations.DataObject;
import io.vertx.codegen.annotations.JsonGen;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.Http2Settings;
import io.vertx.core.http.HttpMethod;
Expand All @@ -32,7 +33,8 @@
/**
* @author <a href="mailto:craigday3@gmail.com">Craig Day</a>
*/
@DataObject(generateConverter = true)
@DataObject
@JsonGen(publicConverter = false)
public class CachingWebClientOptions extends WebClientOptions {

public static final Set<Integer> DEFAULT_CACHED_STATUS_CODES = buildDefaultStatusCodes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
package io.vertx.ext.web.client;

import io.vertx.codegen.annotations.DataObject;
import io.vertx.codegen.annotations.JsonGen;
import io.vertx.core.json.JsonObject;

/**
* @author Paulo Lopes
*/
@DataObject(generateConverter = true)
@DataObject
@JsonGen(publicConverter = false)
public class OAuth2WebClientOptions {

/**
Expand Down
Loading

0 comments on commit 9cbff3e

Please sign in to comment.