Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Include serdeable metadata to internal JSON objects (#10526)" #10623

Merged
merged 4 commits into from
Mar 28, 2024
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
14 changes: 2 additions & 12 deletions discovery-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,9 @@ plugins {
dependencies {
annotationProcessor project(":inject-java")
annotationProcessor project(":graal")

annotationProcessor(platform(libs.test.boms.micronaut.serde))
annotationProcessor(libs.micronaut.serde.processor) {
exclude group: "io.micronaut", module: "json-core"
}

api project(':context')
implementation libs.managed.reactor

compileOnly project(":jackson-databind")
compileOnly(platform(libs.test.boms.micronaut.serde))
compileOnly(libs.micronaut.serde.api) {
exclude group: "io.micronaut", module: "json-core"
}

testImplementation project(":jackson-databind")
// api project(":http")
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
package io.micronaut.health;

import com.fasterxml.jackson.annotation.JsonValue;
import io.micronaut.core.annotation.Introspected;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.annotation.ReflectiveAccess;
import io.micronaut.serde.annotation.Serdeable;

import java.util.Optional;

Expand All @@ -29,7 +29,7 @@
* @author Graeme Rocher
* @since 1.0
*/
@Serdeable
@Introspected
@ReflectiveAccess
public class HealthStatus implements Comparable<HealthStatus> {

Expand Down
6 changes: 0 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ managed-snakeyaml = "2.2"
managed-java-parser-core = "3.25.9"
managed-ksp = "1.9.23-1.0.19"
micronaut-docs = "2.0.0"
micronaut-serde = "2.8.1"

[libraries]
# Libraries prefixed with bom- are BOM files
Expand All @@ -87,7 +86,6 @@ test-boms-micronaut-validation = { module = "io.micronaut.validation:micronaut-v
test-boms-micronaut-rxjava2 = { module = "io.micronaut.rxjava2:micronaut-rxjava2-bom", version.ref = "micronaut-rxjava2" }
test-boms-micronaut-rxjava3 = { module = "io.micronaut.rxjava3:micronaut-rxjava3-bom", version.ref = "micronaut-rxjava3" }
test-boms-micronaut-reactor = { module = "io.micronaut.reactor:micronaut-reactor-bom", version.ref = "micronaut-reactor" }
test-boms-micronaut-serde = { module = "io.micronaut.serde:micronaut-serde-bom", version.ref = "micronaut-serde" }

boms-groovy = { module = "org.apache.groovy:groovy-bom", version.ref = "managed-groovy" }
boms-kotlin = { module = "org.jetbrains.kotlin:kotlin-bom", version.ref = "managed-kotlin" }
Expand Down Expand Up @@ -264,10 +262,6 @@ micronaut-tracing-brave = { module = "io.micronaut.tracing:micronaut-tracing-bra
micronaut-validation = { module = "io.micronaut.validation:micronaut-validation" }
micronaut-validation-processor = { module = "io.micronaut.validation:micronaut-validation-processor" }

micronaut-serde-api = { module = "io.micronaut.serde:micronaut-serde-api" }
micronaut-serde-processor = { module = "io.micronaut.serde:micronaut-serde-processor" }
micronaut-serde-jackson = { module = "io.micronaut.serde:micronaut-serde-jackson" }

testcontainers-spock = { module = "org.testcontainers:spock", version.ref = "testcontainers" }

vertx = { module = "io.vertx:vertx-core", version.ref = "vertx" }
Expand Down
11 changes: 0 additions & 11 deletions http/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@ plugins {
dependencies {
annotationProcessor project(":inject-java")
annotationProcessor project(":graal")

annotationProcessor(platform(libs.test.boms.micronaut.serde))
annotationProcessor(libs.micronaut.serde.processor) {
exclude group: "io.micronaut", module: "json-core"
}

api project(":context")
api project(":core-reactive")
implementation project(":context-propagation")
implementation libs.managed.reactor
compileOnly libs.managed.kotlinx.coroutines.core
compileOnly libs.managed.kotlinx.coroutines.reactor

compileOnly(platform(libs.test.boms.micronaut.serde))
compileOnly(libs.micronaut.serde.api) {
exclude group: "io.micronaut", module: "json-core"
}

compileOnly libs.managed.jackson.annotations

testCompileOnly project(":inject-groovy")
Expand Down
13 changes: 3 additions & 10 deletions http/src/main/java/io/micronaut/http/hateoas/AbstractResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,16 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import io.micronaut.core.annotation.Internal;
import io.micronaut.core.annotation.Introspected;
import io.micronaut.core.annotation.Nullable;
import io.micronaut.core.annotation.ReflectiveAccess;
import io.micronaut.core.convert.value.ConvertibleValues;
import io.micronaut.core.util.StringUtils;
import io.micronaut.core.value.OptionalMultiValues;
import io.micronaut.http.MediaType;
import io.micronaut.http.annotation.Produces;
import io.micronaut.serde.annotation.Serdeable;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;

/**
* An abstract implementation of {@link Resource}.
Expand All @@ -42,10 +36,9 @@
* @since 1.1
*/
@Produces(MediaType.APPLICATION_HAL_JSON)
@Serdeable
@Introspected
@SuppressWarnings("java:S119") // Impl is a better name than T
public abstract class AbstractResource<Impl extends AbstractResource<Impl>> implements Resource {

private final Map<CharSequence, List<Link>> linkMap = new LinkedHashMap<>(1);
private final Map<CharSequence, List<Resource>> embeddedMap = new LinkedHashMap<>(1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import io.micronaut.core.annotation.Internal;
import io.micronaut.core.annotation.Introspected;
import io.micronaut.core.util.ObjectUtils;
import io.micronaut.serde.annotation.Serdeable;

import java.util.LinkedHashMap;
import java.util.Map;
Expand All @@ -31,7 +31,7 @@
* @since 3.4.0
* @author yawkat
*/
@Serdeable
@Introspected
public final class GenericResource extends AbstractResource<GenericResource> {
private final Map<String, Object> additionalProperties = new LinkedHashMap<>();

Expand Down
3 changes: 0 additions & 3 deletions http/src/main/java/io/micronaut/http/hateoas/JsonError.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import io.micronaut.http.annotation.Produces;

import io.micronaut.core.annotation.Nullable;
import io.micronaut.serde.annotation.Serdeable;

import java.util.Optional;

/**
Expand All @@ -32,7 +30,6 @@
* @author Graeme Rocher
* @since 1.1
*/
@Serdeable
@Produces(MediaType.APPLICATION_JSON)
public class JsonError extends AbstractResource<JsonError> {

Expand Down
2 changes: 0 additions & 2 deletions http/src/main/java/io/micronaut/http/hateoas/Resource.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@
import io.micronaut.core.annotation.Internal;
import io.micronaut.core.annotation.Introspected;
import io.micronaut.core.value.OptionalMultiValues;
import io.micronaut.serde.annotation.Serdeable;

/**
* Represents a REST resource in a hateoas architecture.
*
* @author Graeme Rocher
* @since 1.1
*/
@Serdeable
@Introspected
public interface Resource {

Expand Down
2 changes: 0 additions & 2 deletions http/src/main/java/io/micronaut/http/hateoas/VndError.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import io.micronaut.core.annotation.Nullable;
import io.micronaut.http.MediaType;
import io.micronaut.http.annotation.Produces;
import io.micronaut.serde.annotation.Serdeable;

import java.util.List;

Expand All @@ -30,7 +29,6 @@
* @since 1.1
*/
@Produces(MediaType.APPLICATION_VND_ERROR)
@Serdeable
public class VndError extends JsonError {

/**
Expand Down
10 changes: 0 additions & 10 deletions management/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ dependencies {
annotationProcessor project(":inject-java")
annotationProcessor project(":graal")

annotationProcessor(platform(libs.test.boms.micronaut.serde))
annotationProcessor(libs.micronaut.serde.processor) {
exclude group: "io.micronaut", module: "json-core"
}

api project(":router")
api project(":discovery-core")
compileOnly project(":jackson-databind")
Expand Down Expand Up @@ -44,9 +39,4 @@ dependencies {
compileOnly libs.logback.classic
compileOnly libs.log4j

compileOnly(platform(libs.test.boms.micronaut.serde))
compileOnly(libs.micronaut.serde.api) {
exclude group: "io.micronaut", module: "json-core"
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
package io.micronaut.management.health.indicator;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.micronaut.core.annotation.Introspected;
import io.micronaut.core.annotation.ReflectiveAccess;
import io.micronaut.health.HealthStatus;
import io.micronaut.serde.annotation.Serdeable;
import jakarta.validation.constraints.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -32,9 +32,9 @@
* @author James Kleeh
* @since 1.0
*/
@Serdeable
@JsonDeserialize(as = DefaultHealthResult.class)
@Introspected
@ReflectiveAccess
@JsonDeserialize(as = DefaultHealthResult.class)
public interface HealthResult {

/**
Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ include "test-suite-logback"
include "test-suite-logback-external-configuration"
include "test-suite-logback-graalvm"
include "test-suite-netty-ssl-graalvm"
include "test-suite-serde"
include "test-utils"

// benchmarks
Expand Down
18 changes: 0 additions & 18 deletions test-suite-serde/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

Loading