From 151e8dc0211fcf77dbf00b9847271f695df8b513 Mon Sep 17 00:00:00 2001 From: Sergio del Amo Date: Wed, 14 Aug 2024 08:55:56 +0200 Subject: [PATCH 01/60] ci: projectVersion=5.8.0-SNAPSHOT [ci skip] --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index b713259f9..4da8e4912 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.7.1-SNAPSHOT +projectVersion=5.8.0-SNAPSHOT projectGroup=io.micronaut.spring title=Micronaut for Spring From 738239ee78de12593dbad0630043fc252f2cd47e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 08:56:42 +0200 Subject: [PATCH 02/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.6.0 (#606) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2b2db1f8e..f827ba8f4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.10" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.5.3" +micronaut = "4.6.0" micronaut-docs = "2.0.0" micronaut-test = "4.2.0" micronaut-cache = "4.3.0" From 3e422e09c9943602be536deb5d558a664a0d1004 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 08:56:58 +0200 Subject: [PATCH 03/60] fix(deps): update spring core to v6.1.11 (#599) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f827ba8f4..6801f1e08 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] managed-spring-boot = "3.3.2" -managed-spring = "6.1.10" +managed-spring = "6.1.11" groovy = "4.0.18" h2 = '2.3.232' From 330c2892b0460ec2d5bb84d4d88ec180a28d6326 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 08:57:14 +0200 Subject: [PATCH 04/60] fix(deps): update dependency io.micronaut.servlet:micronaut-servlet-bom to v4.9.2 (#590) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6801f1e08..2e39b0c2a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ micronaut-test = "4.2.0" micronaut-cache = "4.3.0" micronaut-views = "5.4.4" micronaut-validation = "4.6.1" -micronaut-servlet = "4.8.0" +micronaut-servlet = "4.9.2" [libraries] # Micronaut From 2e06edab6089cfcfc0eb5695419d7771b55c0874 Mon Sep 17 00:00:00 2001 From: Sergio del Amo Date: Wed, 14 Aug 2024 09:05:39 +0200 Subject: [PATCH 05/60] build: Micronaut Test 4.4.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2e39b0c2a..25ffc5a80 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ h2 = '2.3.232' micronaut = "4.6.0" micronaut-docs = "2.0.0" -micronaut-test = "4.2.0" +micronaut-test = "4.4.0" micronaut-cache = "4.3.0" micronaut-views = "5.4.4" micronaut-validation = "4.6.1" From d1a8b84d3da0170c5de92286a3578f080792c9c9 Mon Sep 17 00:00:00 2001 From: micronaut-build Date: Wed, 14 Aug 2024 08:23:00 +0000 Subject: [PATCH 06/60] [skip ci] Release v5.8.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 4da8e4912..99e780765 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.8.0-SNAPSHOT +projectVersion=5.8.0 projectGroup=io.micronaut.spring title=Micronaut for Spring From 6df59061aad1afe1a17355b2803bf9d8c38cc5cd Mon Sep 17 00:00:00 2001 From: micronaut-build Date: Wed, 14 Aug 2024 08:27:37 +0000 Subject: [PATCH 07/60] chore: Bump version to 5.8.1-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 99e780765..6d9bafa92 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.8.0 +projectVersion=5.8.1-SNAPSHOT projectGroup=io.micronaut.spring title=Micronaut for Spring From 4b5b28122f7be86ac0fd7c6264996183eca1cd05 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 24 Aug 2024 21:04:55 +0000 Subject: [PATCH 08/60] chore(deps): update plugin io.micronaut.build.shared.settings to v7.2.1 (#615) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index 7e2fb1d0f..a240c5ebe 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,7 +6,7 @@ pluginManagement { } plugins { - id 'io.micronaut.build.shared.settings' version '7.2.0' + id 'io.micronaut.build.shared.settings' version '7.2.1' } rootProject.name = 'spring-parent' From a69939c9ca5d1fe3312dedbd731d5dbd1df21e3d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 25 Aug 2024 00:34:12 +0000 Subject: [PATCH 09/60] fix(deps): update spring boot to v3.3.3 (#616) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 25ffc5a80..6e4fc4d6c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -managed-spring-boot = "3.3.2" +managed-spring-boot = "3.3.3" managed-spring = "6.1.11" groovy = "4.0.18" From b5e5310954c067394e41b3686edc5fb55e3cb05d Mon Sep 17 00:00:00 2001 From: altro3 Date: Mon, 2 Sep 2024 19:24:12 +0700 Subject: [PATCH 10/60] Added 2 more mappers: (#619) PathVariableAnnotationMapper RequestAttributeAnnotationMapper Corrections in existed mappers: added map to required flag --- .../CookieValueAnnotationMapper.java | 32 ++++++++-- .../PathVariableAnnotationMapper.java | 53 +++++++++++++++++ .../RequestAttributeAnnotationMapper.java | 59 +++++++++++++++++++ ....java => RequestBodyAnnotationMapper.java} | 22 ++++--- .../RequestHeaderAnnotationMapper.java | 38 +++++++++--- .../RequestMappingAnnotationTransformer.java | 54 ++++++++--------- .../RequestParamAnnotationMapper.java | 31 ++++++++-- .../RequestPartAnnotationMapper.java | 34 +++++++++-- .../ResponseStatusAnnotationMapper.java | 4 +- ...cronaut.inject.annotation.AnnotationMapper | 8 ++- ...ut.inject.annotation.AnnotationTransformer | 1 - .../web/ResponseEntityServerFilter.java | 6 +- .../web/annotation/RestControllerSpec.groovy | 38 +++++++++++- .../spring/web/annotation/GreetingClient.java | 18 +++--- .../web/annotation/GreetingController.java | 30 ++++++---- 15 files changed, 340 insertions(+), 88 deletions(-) create mode 100644 spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/PathVariableAnnotationMapper.java create mode 100644 spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestAttributeAnnotationMapper.java rename spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/{RequestBodyAnnotationMapping.java => RequestBodyAnnotationMapper.java} (62%) diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/CookieValueAnnotationMapper.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/CookieValueAnnotationMapper.java index 7982db0c2..fad08fd1e 100644 --- a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/CookieValueAnnotationMapper.java +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/CookieValueAnnotationMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 original authors + * Copyright 2017-2024 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,15 @@ */ package io.micronaut.spring.web.annotation; +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.Nullable; import io.micronaut.http.annotation.CookieValue; +import io.micronaut.inject.visitor.VisitorContext; +import io.micronaut.spring.annotation.AbstractSpringAnnotationMapper; + +import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.List; /** * Maps Spring CookieValue to Micronaut. @@ -23,14 +31,30 @@ * @author graemerocher * @since 1.0 */ -public class CookieValueAnnotationMapper extends WebBindAnnotationMapper { +public class CookieValueAnnotationMapper extends AbstractSpringAnnotationMapper { @Override public String getName() { return "org.springframework.web.bind.annotation.CookieValue"; } @Override - Class annotationType() { - return CookieValue.class; + protected List> mapInternal(AnnotationValue annotation, VisitorContext visitorContext) { + var annotations = new ArrayList>(); + + var builder = AnnotationValue.builder(CookieValue.class); + var name = annotation.stringValue().orElse(annotation.stringValue("name").orElse(null)); + if (name != null) { + builder.member("value", name); + } + + annotation.stringValue("defaultValue").ifPresent(defaultValue -> builder.member("defaultValue", defaultValue)); + annotations.add(builder.build()); + + var isRequired = annotation.booleanValue("required").orElse(true); + if (!isRequired) { + annotations.add(AnnotationValue.builder(Nullable.class).build()); + } + + return annotations; } } diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/PathVariableAnnotationMapper.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/PathVariableAnnotationMapper.java new file mode 100644 index 000000000..0dca37c4a --- /dev/null +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/PathVariableAnnotationMapper.java @@ -0,0 +1,53 @@ +/* + * Copyright 2017-2024 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation; + +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.http.annotation.PathVariable; +import io.micronaut.inject.visitor.VisitorContext; +import io.micronaut.spring.annotation.AbstractSpringAnnotationMapper; + +import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.List; + +/** + * Maps Spring RequestMapping to Micronaut. + * + * @author graemerocher + * @since 1.0 + */ +public class PathVariableAnnotationMapper extends AbstractSpringAnnotationMapper { + @Override + public String getName() { + return "org.springframework.web.bind.annotation.PathVariable"; + } + + @Override + protected List> mapInternal(AnnotationValue annotation, VisitorContext visitorContext) { + var annotations = new ArrayList>(); + + annotations.add(AnnotationValue.builder(PathVariable.class).member("value", annotation.stringValue().orElse("")).build()); + + var isRequired = annotation.booleanValue("required").orElse(true); + if (!isRequired) { + annotations.add(AnnotationValue.builder(Nullable.class).build()); + } + + return annotations; + } +} diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestAttributeAnnotationMapper.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestAttributeAnnotationMapper.java new file mode 100644 index 000000000..40509acf9 --- /dev/null +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestAttributeAnnotationMapper.java @@ -0,0 +1,59 @@ +/* + * Copyright 2017-2024 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation; + +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.http.annotation.RequestAttribute; +import io.micronaut.inject.visitor.VisitorContext; +import io.micronaut.spring.annotation.AbstractSpringAnnotationMapper; + +import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.List; + +/** + * Maps Spring RequestParam to Micronaut. + * + * @author graemerocher + * @since 1.0 + */ +public class RequestAttributeAnnotationMapper extends AbstractSpringAnnotationMapper { + @Override + public String getName() { + return "org.springframework.web.bind.annotation.RequestAttribute"; + } + + @Override + protected List> mapInternal(AnnotationValue annotation, VisitorContext visitorContext) { + var annotations = new ArrayList>(); + + var builder = AnnotationValue.builder(RequestAttribute.class); + var name = annotation.stringValue().orElse(annotation.stringValue("name").orElse(null)); + if (name != null) { + builder.member("value", name); + } + + annotations.add(builder.build()); + + var isRequired = annotation.booleanValue("required").orElse(true); + if (!isRequired) { + annotations.add(AnnotationValue.builder(Nullable.class).build()); + } + + return annotations; + } +} diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestBodyAnnotationMapping.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestBodyAnnotationMapper.java similarity index 62% rename from spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestBodyAnnotationMapping.java rename to spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestBodyAnnotationMapper.java index 4ccc4cc31..13aa38a92 100644 --- a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestBodyAnnotationMapping.java +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestBodyAnnotationMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 original authors + * Copyright 2017-2024 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,8 @@ */ package io.micronaut.spring.web.annotation; -import io.micronaut.core.annotation.AnnotationUtil; import io.micronaut.core.annotation.AnnotationValue; -import io.micronaut.core.annotation.AnnotationValueBuilder; +import io.micronaut.core.annotation.Nullable; import io.micronaut.core.bind.annotation.Bindable; import io.micronaut.http.annotation.Body; import io.micronaut.inject.visitor.VisitorContext; @@ -33,7 +32,7 @@ * @author graemerocher * @since 1.0 */ -public class RequestBodyAnnotationMapping extends AbstractSpringAnnotationMapper { +public class RequestBodyAnnotationMapper extends AbstractSpringAnnotationMapper { @Override public String getName() { return "org.springframework.web.bind.annotation.RequestBody"; @@ -41,14 +40,13 @@ public String getName() { @Override protected List> mapInternal(AnnotationValue annotation, VisitorContext visitorContext) { - List> mappedAnnotations = new ArrayList<>(); - final boolean required = annotation.booleanValue("required").orElse(true); - final AnnotationValueBuilder builder = AnnotationValue.builder(Body.class); - final AnnotationValueBuilder bindableBuilder = AnnotationValue.builder(Bindable.class); - mappedAnnotations.add(builder.build()); - mappedAnnotations.add(bindableBuilder.build()); - if (!required) { - mappedAnnotations.add(AnnotationValue.builder(AnnotationUtil.NULLABLE).build()); + var mappedAnnotations = new ArrayList>(); + mappedAnnotations.add(AnnotationValue.builder(Body.class).build()); + mappedAnnotations.add(AnnotationValue.builder(Bindable.class).build()); + + var isRequired = annotation.booleanValue("required").orElse(true); + if (!isRequired) { + mappedAnnotations.add(AnnotationValue.builder(Nullable.class).build()); } return mappedAnnotations; } diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestHeaderAnnotationMapper.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestHeaderAnnotationMapper.java index e732cf91a..d1176330b 100644 --- a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestHeaderAnnotationMapper.java +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestHeaderAnnotationMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 original authors + * Copyright 2017-2024 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,22 +15,46 @@ */ package io.micronaut.spring.web.annotation; +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.Nullable; import io.micronaut.http.annotation.Header; +import io.micronaut.inject.visitor.VisitorContext; +import io.micronaut.spring.annotation.AbstractSpringAnnotationMapper; + +import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.List; /** - * Maps Spring RequestHeader to Micronaut. + * Maps Spring RequestMapping to Micronaut. * * @author graemerocher * @since 1.0 */ -public class RequestHeaderAnnotationMapper extends WebBindAnnotationMapper
{ +public class RequestHeaderAnnotationMapper extends AbstractSpringAnnotationMapper { @Override - Class
annotationType() { - return Header.class; + public String getName() { + return "org.springframework.web.bind.annotation.RequestHeader"; } @Override - public String getName() { - return "org.springframework.web.bind.annotation.RequestHeader"; + protected List> mapInternal(AnnotationValue annotation, VisitorContext visitorContext) { + + var annotations = new ArrayList>(); + + var builder = AnnotationValue.builder(Header.class); + var name = annotation.stringValue().orElse(annotation.stringValue("name").orElse(null)); + if (name != null) { + builder.member("value", name); + } + annotation.stringValue("defaultValue").ifPresent(defaultValue -> builder.member("defaultValue", defaultValue)); + annotations.add(builder.build()); + + var isRequired = annotation.booleanValue("required").orElse(true); + if (!isRequired) { + annotations.add(AnnotationValue.builder(Nullable.class).build()); + } + + return annotations; } } diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestMappingAnnotationTransformer.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestMappingAnnotationTransformer.java index 0b5b0dc3b..0e42cd5e8 100644 --- a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestMappingAnnotationTransformer.java +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestMappingAnnotationTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 original authors + * Copyright 2017-2024 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,14 +21,23 @@ import io.micronaut.core.annotation.Nullable; import io.micronaut.core.util.ArrayUtils; import io.micronaut.http.HttpMethod; -import io.micronaut.http.annotation.*; +import io.micronaut.http.annotation.Consumes; +import io.micronaut.http.annotation.Delete; +import io.micronaut.http.annotation.Get; +import io.micronaut.http.annotation.Head; +import io.micronaut.http.annotation.HttpMethodMapping; +import io.micronaut.http.annotation.Options; +import io.micronaut.http.annotation.Patch; +import io.micronaut.http.annotation.Post; +import io.micronaut.http.annotation.Produces; +import io.micronaut.http.annotation.Put; +import io.micronaut.http.annotation.Trace; import io.micronaut.inject.annotation.NamedAnnotationTransformer; import io.micronaut.inject.visitor.VisitorContext; import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.List; -import java.util.Optional; /** * Maps Spring RequestMapping to Micronaut. @@ -62,26 +71,17 @@ protected boolean isHttpMethodMapping(@Nullable HttpMethod method) { AnnotationValue annotation) { if (httpMethod != null) { - switch (httpMethod) { - case TRACE: - return AnnotationValue.builder(Trace.class); - case DELETE: - return AnnotationValue.builder(Delete.class); - case GET: - return AnnotationValue.builder(Get.class); - case HEAD: - return AnnotationValue.builder(Head.class); - case POST: - return AnnotationValue.builder(Post.class); - case PUT: - return AnnotationValue.builder(Put.class); - case PATCH: - return AnnotationValue.builder(Patch.class); - case OPTIONS: - return AnnotationValue.builder(Options.class); - default: - return AnnotationValue.builder("io.micronaut.http.annotation.UriMapping"); - } + return switch (httpMethod) { + case TRACE -> AnnotationValue.builder(Trace.class); + case DELETE -> AnnotationValue.builder(Delete.class); + case GET -> AnnotationValue.builder(Get.class); + case HEAD -> AnnotationValue.builder(Head.class); + case POST -> AnnotationValue.builder(Post.class); + case PUT -> AnnotationValue.builder(Put.class); + case PATCH -> AnnotationValue.builder(Patch.class); + case OPTIONS -> AnnotationValue.builder(Options.class); + default -> AnnotationValue.builder("io.micronaut.http.annotation.UriMapping"); + }; } else { return AnnotationValue.builder("io.micronaut.http.annotation.UriMapping"); } @@ -93,12 +93,12 @@ private String computePath(AnnotationValue annotation) { @Override public List> transform(AnnotationValue annotation, VisitorContext visitorContext) { - List> annotations = new ArrayList<>(); + var annotations = new ArrayList>(); final String path = computePath(annotation); - final Optional method = annotation.enumValue("method", HttpMethod.class); + var method = annotation.enumValue("method", HttpMethod.class).orElse(null); - annotations.add(newBuilder(method.orElse(null), annotation).value(path).build()); + annotations.add(newBuilder(method, annotation).value(path).build()); final String[] consumes = annotation.stringValues("consumes"); final String[] produces = annotation.stringValues("produces"); @@ -110,7 +110,7 @@ public List> transform(AnnotationValue annotation annotations.add(AnnotationValue.builder(Produces.class).member("value", produces).build()); } - if (isHttpMethodMapping(method.orElse(null))) { + if (isHttpMethodMapping(method)) { annotations.add(AnnotationValue.builder(HttpMethodMapping.class).value(path).build()); } return annotations; diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestParamAnnotationMapper.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestParamAnnotationMapper.java index eb59dffb0..323138823 100644 --- a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestParamAnnotationMapper.java +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestParamAnnotationMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 original authors + * Copyright 2017-2024 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,15 @@ */ package io.micronaut.spring.web.annotation; +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.Nullable; import io.micronaut.http.annotation.QueryValue; +import io.micronaut.inject.visitor.VisitorContext; +import io.micronaut.spring.annotation.AbstractSpringAnnotationMapper; + +import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.List; /** * Maps Spring RequestParam to Micronaut. @@ -23,14 +31,29 @@ * @author graemerocher * @since 1.0 */ -public class RequestParamAnnotationMapper extends WebBindAnnotationMapper { +public class RequestParamAnnotationMapper extends AbstractSpringAnnotationMapper { @Override public String getName() { return "org.springframework.web.bind.annotation.RequestParam"; } @Override - Class annotationType() { - return QueryValue.class; + protected List> mapInternal(AnnotationValue annotation, VisitorContext visitorContext) { + var annotations = new ArrayList>(); + + var builder = AnnotationValue.builder(QueryValue.class); + var name = annotation.stringValue().orElse(annotation.stringValue("name").orElse(null)); + if (name != null) { + builder.member("value", name); + } + annotation.stringValue("defaultValue").ifPresent(defaultValue -> builder.member("defaultValue", defaultValue)); + annotations.add(builder.build()); + + var isRequired = annotation.booleanValue("required").orElse(true); + if (!isRequired) { + annotations.add(AnnotationValue.builder(Nullable.class).build()); + } + + return annotations; } } diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestPartAnnotationMapper.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestPartAnnotationMapper.java index 3fa402ad7..aa5a04e0d 100644 --- a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestPartAnnotationMapper.java +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestPartAnnotationMapper.java @@ -15,22 +15,44 @@ */ package io.micronaut.spring.web.annotation; +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.Nullable; import io.micronaut.http.annotation.Part; +import io.micronaut.inject.visitor.VisitorContext; +import io.micronaut.spring.annotation.AbstractSpringAnnotationMapper; + +import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.List; /** - * Maps Spring RequestParam to Micronaut. + * Maps Spring RequestMapping to Micronaut. * - * @since 5.4.1 + * @author graemerocher + * @since 1.0 */ -public class RequestPartAnnotationMapper extends WebBindAnnotationMapper { - +public class RequestPartAnnotationMapper extends AbstractSpringAnnotationMapper { @Override public String getName() { return "org.springframework.web.bind.annotation.RequestPart"; } @Override - Class annotationType() { - return Part.class; + protected List> mapInternal(AnnotationValue annotation, VisitorContext visitorContext) { + var annotations = new ArrayList>(); + + var builder = AnnotationValue.builder(Part.class); + var name = annotation.stringValue().orElse(annotation.stringValue("name").orElse(null)); + if (name != null) { + builder.member("value", name); + } + annotations.add(builder.build()); + + var isRequired = annotation.booleanValue("required").orElse(true); + if (!isRequired) { + annotations.add(AnnotationValue.builder(Nullable.class).build()); + } + + return annotations; } } diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/ResponseStatusAnnotationMapper.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/ResponseStatusAnnotationMapper.java index c10cd0943..f7a68345f 100644 --- a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/ResponseStatusAnnotationMapper.java +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/ResponseStatusAnnotationMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 original authors + * Copyright 2017-2024 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ public String getName() { protected List> mapInternal(AnnotationValue annotation, VisitorContext visitorContext) { try { final String code = annotation.stringValue().orElse(annotation.stringValue("code").orElse(null)); - final HttpStatus status = HttpStatus.valueOf(code); + var status = HttpStatus.valueOf(code); return Collections.singletonList( AnnotationValue.builder(Status.class).value(status).build() diff --git a/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationMapper b/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationMapper index 1290ff0f9..61ea488d1 100644 --- a/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationMapper +++ b/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationMapper @@ -1,8 +1,10 @@ +io.micronaut.spring.web.annotation.RequestBodyAnnotationMapper io.micronaut.spring.web.annotation.RequestParamAnnotationMapper io.micronaut.spring.web.annotation.RequestPartAnnotationMapper -io.micronaut.spring.web.annotation.RestControllerAnnotationMapper -io.micronaut.spring.web.annotation.CookieValueAnnotationMapper io.micronaut.spring.web.annotation.RequestHeaderAnnotationMapper -io.micronaut.spring.web.annotation.RequestBodyAnnotationMapping +io.micronaut.spring.web.annotation.PathVariableAnnotationMapper +io.micronaut.spring.web.annotation.CookieValueAnnotationMapper +io.micronaut.spring.web.annotation.RequestAttributeAnnotationMapper io.micronaut.spring.web.annotation.ResponseStatusAnnotationMapper +io.micronaut.spring.web.annotation.RestControllerAnnotationMapper io.micronaut.spring.web.annotation.ExceptionHandlerAnnotationMapper diff --git a/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationTransformer b/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationTransformer index 1da11c446..562e8a7e8 100644 --- a/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationTransformer +++ b/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationTransformer @@ -4,4 +4,3 @@ io.micronaut.spring.web.annotation.PostMappingAnnotationTransformer io.micronaut.spring.web.annotation.PatchMappingAnnotationTransformer io.micronaut.spring.web.annotation.DeleteMappingAnnotationTransformer io.micronaut.spring.web.annotation.GetMappingAnnotationTransformer - diff --git a/spring-web/src/main/java/io/micronaut/spring/web/ResponseEntityServerFilter.java b/spring-web/src/main/java/io/micronaut/spring/web/ResponseEntityServerFilter.java index ce5f294d0..b93321c4e 100644 --- a/spring-web/src/main/java/io/micronaut/spring/web/ResponseEntityServerFilter.java +++ b/spring-web/src/main/java/io/micronaut/spring/web/ResponseEntityServerFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2020 original authors + * Copyright 2017-2024 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,9 @@ public Publisher> doFilter(HttpRequest request, Server final String key = entry.getKey(); final List value = entry.getValue(); for (String v : value) { - micronautHeaders.add(key, v); + if (v != null) { + micronautHeaders.add(key, v); + } } } final Object b = entity.getBody(); diff --git a/spring-web/src/test/groovy/io/micronaut/spring/web/annotation/RestControllerSpec.groovy b/spring-web/src/test/groovy/io/micronaut/spring/web/annotation/RestControllerSpec.groovy index 507d6cd27..61dea32f5 100644 --- a/spring-web/src/test/groovy/io/micronaut/spring/web/annotation/RestControllerSpec.groovy +++ b/spring-web/src/test/groovy/io/micronaut/spring/web/annotation/RestControllerSpec.groovy @@ -1,5 +1,5 @@ /* - * Copyright 2017-2019 original authors + * Copyright 2017-2024 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,16 @@ class RestControllerSpec extends Specification { then: response.status() == HttpStatus.NO_CONTENT response.header("Foo") == "Bar" + !response.header("myHeader") + + when: + var myHeaderValue = "myHeaderValue" + response = greetingClient.deletePost(myHeaderValue) + + then: + response.status() == HttpStatus.NO_CONTENT + response.header("Foo") == "Bar" + response.header("myHeader") == myHeaderValue } void "test request controller validation"() { @@ -79,5 +89,31 @@ class RestControllerSpec extends Specification { then: response == json + '#' + fileContent + + when: + def notRequiredPart = "this is not required part" + response = greetingClient.multipartRequest(MultipartBody.builder() + .addPart("json", json) + .addPart("notRequiredPart", notRequiredPart) + .addPart("myFile", "myFileName", fileContent.bytes) + .build()) + + then: + response == json + '#' + notRequiredPart + '#' + fileContent + } + + void "test optional pathVar"() { + + when: + def responseForNull = greetingClient.withOptVar(null) + + then: + responseForNull == 'optVar is null!' + + when: + def response = greetingClient.withOptVar("This is path var") + + then: + response == 'Hello, This is path var!' } } diff --git a/spring-web/src/test/java/io/micronaut/spring/web/annotation/GreetingClient.java b/spring-web/src/test/java/io/micronaut/spring/web/annotation/GreetingClient.java index 7df0e1406..497307f68 100644 --- a/spring-web/src/test/java/io/micronaut/spring/web/annotation/GreetingClient.java +++ b/spring-web/src/test/java/io/micronaut/spring/web/annotation/GreetingClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2019 original authors + * Copyright 2017-2024 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,17 +15,18 @@ */ package io.micronaut.spring.web.annotation; -import io.micronaut.core.annotation.Nullable; import io.micronaut.http.HttpResponse; import io.micronaut.http.annotation.Header; import io.micronaut.http.client.annotation.Client; import io.micronaut.http.client.multipart.MultipartBody; - import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; @Client("/") public interface GreetingClient { @@ -37,20 +38,23 @@ public interface GreetingClient { @Header(name = "Foo", value = "Bar") Greeting requestTest(@RequestBody Greeting greeting); + @GetMapping("/withOptVar{/optVar}") + String withOptVar(@PathVariable(required = false) String optVar); + @GetMapping("/greeting{?name}") - Greeting greet(@Nullable String name); + Greeting greet(@RequestParam(required = false) String name); @PostMapping("/greeting") Greeting greetByPost(@RequestBody Greeting greeting); @DeleteMapping("/greeting") - HttpResponse deletePost(); + HttpResponse deletePost(@RequestHeader(required = false) String myHeader); @GetMapping("/nested/greeting{?name}") - Greeting nestedGreet(@Nullable String name); + Greeting nestedGreet(@RequestParam(required = false) String name); @GetMapping("/greeting-status{?name}") - HttpResponse greetWithStatus(@Nullable String name); + HttpResponse greetWithStatus(@RequestParam(required = false) String name); @PostMapping(value = "/multipart-request", consumes = MediaType.TEXT_PLAIN_VALUE, produces = MediaType.MULTIPART_FORM_DATA_VALUE) String multipartRequest(@RequestBody MultipartBody body); diff --git a/spring-web/src/test/java/io/micronaut/spring/web/annotation/GreetingController.java b/spring-web/src/test/java/io/micronaut/spring/web/annotation/GreetingController.java index 40836d87e..170e0c8cb 100644 --- a/spring-web/src/test/java/io/micronaut/spring/web/annotation/GreetingController.java +++ b/spring-web/src/test/java/io/micronaut/spring/web/annotation/GreetingController.java @@ -1,5 +1,5 @@ /* - * Copyright 2017-2019 original authors + * Copyright 2017-2024 original authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,13 +15,9 @@ */ package io.micronaut.spring.web.annotation; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.concurrent.atomic.AtomicLong; - import io.micronaut.http.multipart.CompletedFileUpload; import io.micronaut.validation.Validated; - +import jakarta.validation.constraints.Pattern; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; @@ -31,17 +27,21 @@ import org.springframework.util.LinkedMultiValueMap; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; - -import jakarta.validation.constraints.Pattern; import reactor.core.publisher.Flux; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.atomic.AtomicLong; + import static org.junit.Assert.assertEquals; @RestController @@ -58,6 +58,11 @@ public String home(Model model) { return "welcome"; } + @GetMapping("/withOptVar{/optVar}") + public String withOptVar(@PathVariable(required = false) String optVar) { + return optVar == null ? "optVar is null!" : String.format(TEMPLATE, optVar); + } + @PostMapping("/request") public Flux request(ServerHttpRequest request, HttpMethod method) { assertEquals("/request", request.getPath().value()); @@ -65,7 +70,7 @@ public Flux request(ServerHttpRequest request, HttpMethod method) { assertEquals(HttpMethod.POST, method); assertEquals("Bar", request.getHeaders().getFirst("Foo")); return request.getBody().map(dataBuffer -> { - byte[] bytes = new byte[dataBuffer.readableByteCount()]; + var bytes = new byte[dataBuffer.readableByteCount()]; dataBuffer.read(bytes); return new String(bytes, StandardCharsets.UTF_8); }); @@ -82,9 +87,10 @@ public Greeting greetingByPost(@RequestBody Greeting greeting) { } @DeleteMapping("/greeting") - public ResponseEntity deleteGreeting() { + public ResponseEntity deleteGreeting(@RequestHeader(name = "myHeader", required = false) String myHeader) { var headers = new LinkedMultiValueMap(); headers.add("Foo", "Bar"); + headers.add("myHeader", myHeader); return new ResponseEntity<>(headers, HttpStatus.NO_CONTENT); } @@ -96,9 +102,9 @@ public Greeting greetingWithStatus(@RequestParam(value = "name", defaultValue = @PostMapping(value = "/multipart-request", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, produces = MediaType.TEXT_PLAIN_VALUE) public String multipartRequest(@RequestPart String json, + @RequestPart(required = false) String notRequiredPart, @RequestPart("myFile") CompletedFileUpload file) throws IOException { - return json + '#' + new String(file.getInputStream().readAllBytes()); + return json + (notRequiredPart != null ? "#" + notRequiredPart : "") + '#' + new String(file.getInputStream().readAllBytes()); } - } From a06d293edb60f02731d0873eb16f1c4ee7fa48a7 Mon Sep 17 00:00:00 2001 From: micronaut-build <65172877+micronaut-build@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:24:33 +0200 Subject: [PATCH 11/60] Update common files (#614) --- .github/workflows/release.yml | 2 +- gradle/wrapper/gradle-wrapper.jar | Bin 43504 -> 43583 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9efeb2040..f4bfd84ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -160,6 +160,6 @@ jobs: - name: Upload assets # Upload the artifacts to the existing release. Note that the SLSA provenance will # attest to each artifact file and not the aggregated ZIP file. - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15 + uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8 with: files: artifacts.zip diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 2c3521197d7c4586c843d1d3e9090525f1898cde..a4b76b9530d66f5e68d973ea569d8e19de379189 100644 GIT binary patch delta 3990 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 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 09523c0e5..9355b4155 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From d00e5f7b15bcdcbdd752c4e670eb08c632216770 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 08:25:09 -0400 Subject: [PATCH 12/60] fix(deps): update spring core to v6.1.12 (#608) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Graeme Rocher --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6e4fc4d6c..ddb875038 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] managed-spring-boot = "3.3.3" -managed-spring = "6.1.11" +managed-spring = "6.1.12" groovy = "4.0.18" h2 = '2.3.232' From 8321c560246c9b6a7732a3a837d3d3c1f395dc5d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 08:25:53 -0400 Subject: [PATCH 13/60] fix(deps): update dependency io.micronaut.servlet:micronaut-servlet-bom to v4.10.1 (#610) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Graeme Rocher --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ddb875038..d9ac5e518 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ micronaut-test = "4.4.0" micronaut-cache = "4.3.0" micronaut-views = "5.4.4" micronaut-validation = "4.6.1" -micronaut-servlet = "4.9.2" +micronaut-servlet = "4.10.1" [libraries] # Micronaut From 7bb255dd35af93c87648dc65e5053d2d4be0eb42 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 08:26:37 -0400 Subject: [PATCH 14/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.6.2 (#612) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Graeme Rocher --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d9ac5e518..e11fd3548 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.12" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.6.0" +micronaut = "4.6.2" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.0" From bbc90312e4886be3d64f762366369e280a0350d6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 01:29:26 +0000 Subject: [PATCH 15/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.6.3 (#620) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e11fd3548..ea1e1a5c8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.12" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.6.2" +micronaut = "4.6.3" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.0" From 00d57954d7884c242308aabfaf94285be3706f03 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 00:33:43 +0000 Subject: [PATCH 16/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.6.4 (#622) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ea1e1a5c8..e0d367847 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.12" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.6.3" +micronaut = "4.6.4" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.0" From 687d835b6dcab7f0043314f12e6c2093bd3b2a25 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 02:01:51 +0000 Subject: [PATCH 17/60] fix(deps): update dependency io.micronaut.cache:micronaut-cache-bom to v4.3.1 (#624) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e0d367847..81426dc38 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,7 @@ h2 = '2.3.232' micronaut = "4.6.4" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" -micronaut-cache = "4.3.0" +micronaut-cache = "4.3.1" micronaut-views = "5.4.4" micronaut-validation = "4.6.1" micronaut-servlet = "4.10.1" From 7bbe364fe334362842f72cb58e397f40e4a3b689 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 21:37:42 +0000 Subject: [PATCH 18/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.6.5 (#625) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 81426dc38..a92bdf119 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.12" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.6.4" +micronaut = "4.6.5" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" From cd5a2a88c6a87bd2c8afdee7f258c86692a42f30 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 14 Sep 2024 00:59:46 +0000 Subject: [PATCH 19/60] fix(deps): update spring core to v6.1.13 (#626) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a92bdf119..aaeb7653b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] managed-spring-boot = "3.3.3" -managed-spring = "6.1.12" +managed-spring = "6.1.13" groovy = "4.0.18" h2 = '2.3.232' From 394e6c04101faf1e06eb97da07ca233b22595cb8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 01:24:55 +0000 Subject: [PATCH 20/60] fix(deps): update spring boot to v3.3.4 (#628) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index aaeb7653b..5b0ebe5e9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -managed-spring-boot = "3.3.3" +managed-spring-boot = "3.3.4" managed-spring = "6.1.13" groovy = "4.0.18" From f78cd69e8672c6fa991f2b80ef2e0576c7acd362 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 00:57:17 +0000 Subject: [PATCH 21/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.6.6 (#630) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5b0ebe5e9..70ccbce74 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.13" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.6.5" +micronaut = "4.6.6" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" From a9af3012d48cdf4ce0b1aaba660ca46497708765 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:32:20 +0200 Subject: [PATCH 22/60] fix(deps): update dependency io.micronaut.servlet:micronaut-servlet-bom to v4.11.1 (#621) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 70ccbce74..928c2cd9f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ micronaut-test = "4.4.0" micronaut-cache = "4.3.1" micronaut-views = "5.4.4" micronaut-validation = "4.6.1" -micronaut-servlet = "4.10.1" +micronaut-servlet = "4.11.1" [libraries] # Micronaut From 025900cb94b94b811723e74f94f96b9071ba3993 Mon Sep 17 00:00:00 2001 From: micronaut-build <65172877+micronaut-build@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:32:44 +0200 Subject: [PATCH 23/60] Update common files (#609) From fe6a21348d61a457201fcdc3f826d55f55c56311 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:32:56 +0200 Subject: [PATCH 24/60] fix(deps): update dependency io.micronaut.views:micronaut-views-bom to v5.5.1 (#617) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 928c2cd9f..86627d22f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,7 +9,7 @@ micronaut = "4.6.6" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" -micronaut-views = "5.4.4" +micronaut-views = "5.5.1" micronaut-validation = "4.6.1" micronaut-servlet = "4.11.1" From 8ac84ccd2c44a1c360c728773f4a3fef5ea91e5a Mon Sep 17 00:00:00 2001 From: micronaut-build <65172877+micronaut-build@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:33:08 +0200 Subject: [PATCH 25/60] Update common files (#623) --- .github/workflows/gradle.yml | 2 +- .github/workflows/release.yml | 6 +++--- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index be653308d..909b5fd20 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -78,7 +78,7 @@ jobs: - name: "📜 Upload binary compatibility check results" if: matrix.java == '17' - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: name: binary-compatibility-reports path: "**/build/reports/binary-compatibility-*.html" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4bfd84ac..25c56f45c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,13 +66,13 @@ jobs: # Store the hash in a file, which is uploaded as a workflow artifact. sha256sum $ARTIFACTS | base64 -w0 > artifacts-sha256 - name: Upload build artifacts - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: name: gradle-build-outputs path: build/repo/${{ steps.publish.outputs.group }}/*/${{ steps.publish.outputs.version }}/* retention-days: 5 - name: Upload artifacts-sha256 - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: name: artifacts-sha256 path: artifacts-sha256 @@ -146,7 +146,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') steps: - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Download artifacts uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9355b4155..df97d72b8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 131736815f0e106baeb1dd63c6b3b5efc2e58963 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:34:03 +0200 Subject: [PATCH 26/60] fix(deps): update dependency io.micronaut.validation:micronaut-validation-bom to v4.7.0 (#611) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 86627d22f..33f126a74 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,7 +10,7 @@ micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" micronaut-views = "5.5.1" -micronaut-validation = "4.6.1" +micronaut-validation = "4.7.0" micronaut-servlet = "4.11.1" [libraries] From 4ce29c28d6e0de10ee47a80d8a7a55cd8d68a343 Mon Sep 17 00:00:00 2001 From: micronaut-build <65172877+micronaut-build@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:04:54 +0200 Subject: [PATCH 27/60] Update common files (#633) --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 909b5fd20..bec738f30 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -45,7 +45,7 @@ jobs: fetch-depth: 0 - name: "🔧 Setup GraalVM CE" - uses: graalvm/setup-graalvm@v1.2.3 + uses: graalvm/setup-graalvm@v1.2.4 with: distribution: 'graalvm' java-version: ${{ matrix.java }} From 6ec495016580c5238686016f7bce20439631c9ae Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:05:05 +0200 Subject: [PATCH 28/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.7.0 (#631) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 33f126a74..380dd65ce 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.13" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.6.6" +micronaut = "4.7.0" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" From 189d1bd6b0df767b98ce10f0c2cdf016d45aac5e Mon Sep 17 00:00:00 2001 From: micronaut-build Date: Thu, 17 Oct 2024 17:10:57 +0000 Subject: [PATCH 29/60] [skip ci] Release v5.8.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 6d9bafa92..9f08224d8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.8.1-SNAPSHOT +projectVersion=5.8.1 projectGroup=io.micronaut.spring title=Micronaut for Spring From 145e6394596f8ff43198594618d0caf742b0c46a Mon Sep 17 00:00:00 2001 From: micronaut-build Date: Thu, 17 Oct 2024 17:15:39 +0000 Subject: [PATCH 30/60] chore: Bump version to 5.8.2-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 9f08224d8..4ceb5c929 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.8.1 +projectVersion=5.8.2-SNAPSHOT projectGroup=io.micronaut.spring title=Micronaut for Spring From 7facf807b902d783209f6ccdc9a7465a301d2663 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:50:52 +0100 Subject: [PATCH 31/60] fix(deps): update spring boot to v3.3.5 (#639) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 380dd65ce..108bc82c5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -managed-spring-boot = "3.3.4" +managed-spring-boot = "3.3.5" managed-spring = "6.1.13" groovy = "4.0.18" From 4e32645688698e20793b39c23c76cb9e9f39c401 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:51:09 +0100 Subject: [PATCH 32/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.7.1 (#637) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 108bc82c5..ae0ef4deb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.13" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.7.0" +micronaut = "4.7.1" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" From dd37f7d0c8ace38a33fe35666516c60150356e98 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:51:47 +0100 Subject: [PATCH 33/60] fix(deps): update spring core to v6.1.14 (#635) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Sergio del Amo --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ae0ef4deb..06efbcfa8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] managed-spring-boot = "3.3.5" -managed-spring = "6.1.13" +managed-spring = "6.1.14" groovy = "4.0.18" h2 = '2.3.232' From 2e39052ffbcbb68fe3ad0c9c5ac159405bffe5b3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:51:58 +0100 Subject: [PATCH 34/60] chore(deps): update actions/checkout action to v4.2.2 (#629) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25c56f45c..f8f73ac1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -146,7 +146,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') steps: - name: Checkout repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Download artifacts uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: From f11a5ded73cf0b2e3c16dfc84d53746015ac4bf5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:52:11 +0100 Subject: [PATCH 35/60] chore(deps): update plugin io.micronaut.build.shared.settings to v7.2.3 (#634) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index a240c5ebe..e1ec833c4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,7 +6,7 @@ pluginManagement { } plugins { - id 'io.micronaut.build.shared.settings' version '7.2.1' + id 'io.micronaut.build.shared.settings' version '7.2.3' } rootProject.name = 'spring-parent' From 464960b549dde3250e09d8791579066064dbfb5a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:52:20 +0100 Subject: [PATCH 36/60] chore(deps): update actions/upload-artifact action to v4.4.3 (#618) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/gradle.yml | 2 +- .github/workflows/release.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index bec738f30..61536a34b 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -78,7 +78,7 @@ jobs: - name: "📜 Upload binary compatibility check results" if: matrix.java == '17' - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: binary-compatibility-reports path: "**/build/reports/binary-compatibility-*.html" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f8f73ac1a..bc2ac6483 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -66,13 +66,13 @@ jobs: # Store the hash in a file, which is uploaded as a workflow artifact. sha256sum $ARTIFACTS | base64 -w0 > artifacts-sha256 - name: Upload build artifacts - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: gradle-build-outputs path: build/repo/${{ steps.publish.outputs.group }}/*/${{ steps.publish.outputs.version }}/* retention-days: 5 - name: Upload artifacts-sha256 - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: artifacts-sha256 path: artifacts-sha256 From 3dc00800cbc3ce4c108c630aa1f6a5eb1397117a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:52:31 +0100 Subject: [PATCH 37/60] fix(deps): update dependency io.micronaut.validation:micronaut-validation-bom to v4.8.0 (#636) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 06efbcfa8..23f426490 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,7 +10,7 @@ micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" micronaut-views = "5.5.1" -micronaut-validation = "4.7.0" +micronaut-validation = "4.8.0" micronaut-servlet = "4.11.1" [libraries] From 0e0d9ac16390cda1fe61423840172f88a4e56268 Mon Sep 17 00:00:00 2001 From: micronaut-build <65172877+micronaut-build@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:52:42 +0100 Subject: [PATCH 38/60] Update common files (#638) From ec02175fa6241379fdc177d29e609eb9943f43eb Mon Sep 17 00:00:00 2001 From: Sergio del Amo Date: Tue, 29 Oct 2024 09:54:28 +0100 Subject: [PATCH 39/60] ci: projectVersion=5.9.0-SNAPSHOT [ci skip] --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 4ceb5c929..867e2bb62 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.8.2-SNAPSHOT +projectVersion=5.9.0-SNAPSHOT projectGroup=io.micronaut.spring title=Micronaut for Spring From 1046dbb3cc3b224c69e3b5592e7f80d7e2e6d74e Mon Sep 17 00:00:00 2001 From: micronaut-build Date: Tue, 29 Oct 2024 09:10:10 +0000 Subject: [PATCH 40/60] [skip ci] Release v5.9.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 867e2bb62..4386d788b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.9.0-SNAPSHOT +projectVersion=5.9.0 projectGroup=io.micronaut.spring title=Micronaut for Spring From 265dfa4693b24439856f5a68008c511c6ba70011 Mon Sep 17 00:00:00 2001 From: micronaut-build Date: Tue, 29 Oct 2024 09:15:33 +0000 Subject: [PATCH 41/60] chore: Bump version to 5.9.1-SNAPSHOT --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 4386d788b..f71f5b5f8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=5.9.0 +projectVersion=5.9.1-SNAPSHOT projectGroup=io.micronaut.spring title=Micronaut for Spring From 50aa20963fe080f108c3cc96534e62b2352952b4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 00:17:34 +0000 Subject: [PATCH 42/60] chore(deps): update graalvm/setup-graalvm action to v1.2.5 (#640) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 61536a34b..82d258ec5 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -45,7 +45,7 @@ jobs: fetch-depth: 0 - name: "🔧 Setup GraalVM CE" - uses: graalvm/setup-graalvm@v1.2.4 + uses: graalvm/setup-graalvm@v1.2.5 with: distribution: 'graalvm' java-version: ${{ matrix.java }} From 58982a1834bf7cfa7efd0e6783b3ee29b9db3f12 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 01:05:28 +0000 Subject: [PATCH 43/60] chore(deps): update softprops/action-gh-release action to v2.0.9 (#642) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc2ac6483..2dda05848 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -160,6 +160,6 @@ jobs: - name: Upload assets # Upload the artifacts to the existing release. Note that the SLSA provenance will # attest to each artifact file and not the aggregated ZIP file. - uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8 + uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9 with: files: artifacts.zip From a48dd0c4cff9ab575e1c3b9d9da5cadb53138cc8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 2 Nov 2024 01:40:25 +0000 Subject: [PATCH 44/60] fix(deps): update dependency io.micronaut.servlet:micronaut-servlet-bom to v4.11.2 (#643) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 23f426490..63deb6e96 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ micronaut-test = "4.4.0" micronaut-cache = "4.3.1" micronaut-views = "5.5.1" micronaut-validation = "4.8.0" -micronaut-servlet = "4.11.1" +micronaut-servlet = "4.11.2" [libraries] # Micronaut From b588d9f18559c32ab4f611de4904e1f3d179f247 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 01:44:16 +0000 Subject: [PATCH 45/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.7.2 (#645) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 63deb6e96..fd5da5bf8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.14" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.7.1" +micronaut = "4.7.2" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" From a086b975762958c4955c8d1d566406c93455b7f0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 9 Nov 2024 01:47:42 +0000 Subject: [PATCH 46/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.7.3 (#647) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index fd5da5bf8..90c77b864 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.14" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.7.2" +micronaut = "4.7.3" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" From 7f0bb5ee03cfa0688785b180f91b1e8df4525a80 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 00:23:53 +0000 Subject: [PATCH 47/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.7.4 (#649) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 90c77b864..5f40fc3cb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.14" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.7.3" +micronaut = "4.7.4" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" From aca2e6322266654072d39f09f151ccb156f14220 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 01:03:25 +0000 Subject: [PATCH 48/60] chore(deps): update graalvm/setup-graalvm action to v1.2.6 (#651) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 82d258ec5..e72393c34 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -45,7 +45,7 @@ jobs: fetch-depth: 0 - name: "🔧 Setup GraalVM CE" - uses: graalvm/setup-graalvm@v1.2.5 + uses: graalvm/setup-graalvm@v1.2.6 with: distribution: 'graalvm' java-version: ${{ matrix.java }} From 6e4fa7b0a6bf64e842afdcdfe2dd39498402049a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 16 Nov 2024 01:58:10 +0000 Subject: [PATCH 49/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.7.5 (#653) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5f40fc3cb..c1620fd30 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.14" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.7.4" +micronaut = "4.7.5" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" From 975ed644abd1ab0f9137001a38a10467b912407f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Nov 2024 00:11:41 +0000 Subject: [PATCH 50/60] fix(deps): update dependency io.micronaut:micronaut-core-bom to v4.7.6 (#657) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c1620fd30..62a7fc480 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ managed-spring = "6.1.14" groovy = "4.0.18" h2 = '2.3.232' -micronaut = "4.7.5" +micronaut = "4.7.6" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" From 28e0b080ba7cbd559ad4b9bb17a64f3814322edb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:18:07 -0400 Subject: [PATCH 51/60] fix(deps): update spring boot to v3.4.0 (#658) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 62a7fc480..5ed1a6031 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -managed-spring-boot = "3.3.5" +managed-spring-boot = "3.4.0" managed-spring = "6.1.14" groovy = "4.0.18" From b4e33bb080c1111657cb58ba267075810f74b387 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:18:33 -0400 Subject: [PATCH 52/60] fix(deps): update dependency io.micronaut.servlet:micronaut-servlet-bom to v4.12.0 (#646) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5ed1a6031..be94f4f21 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ micronaut-test = "4.4.0" micronaut-cache = "4.3.1" micronaut-views = "5.5.1" micronaut-validation = "4.8.0" -micronaut-servlet = "4.11.2" +micronaut-servlet = "4.12.0" [libraries] # Micronaut From bb66f21452f989cc915460153b88d805ea759d3c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:18:53 -0400 Subject: [PATCH 53/60] fix(deps): update dependency io.micronaut.views:micronaut-views-bom to v5.6.0 (#648) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index be94f4f21..052f3eb92 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,7 +9,7 @@ micronaut = "4.7.6" micronaut-docs = "2.0.0" micronaut-test = "4.4.0" micronaut-cache = "4.3.1" -micronaut-views = "5.5.1" +micronaut-views = "5.6.0" micronaut-validation = "4.8.0" micronaut-servlet = "4.12.0" From 590e0305aa1a26f29fb15afd019db7e205c94350 Mon Sep 17 00:00:00 2001 From: altro3 Date: Mon, 25 Nov 2024 20:19:27 +0700 Subject: [PATCH 54/60] Add support HttpExchange annotations (#652) It's not full support of these annotations, because they primarily describe the client's behavior, i.e. describe its requests for specific endpoints. But Spring allows using these annotations to describe a single API interface. Therefore, it is important for us to have correct mapping of these annotations specifically for the server, i.e. when they are used in the controller to describe endpoints. --- .../RequestMappingAnnotationTransformer.java | 16 +-- .../DeleteExchangeAnnotationTransformer.java | 43 +++++++ .../GetExchangeAnnotationTransformer.java | 43 +++++++ .../HttpExchangeAnnotationTransformer.java | 117 ++++++++++++++++++ .../PatchExchangeAnnotationTransformer.java | 43 +++++++ .../PostExchangeAnnotationTransformer.java | 43 +++++++ .../PutExchangeAnnotationTransformer.java | 43 +++++++ ...ut.inject.annotation.AnnotationTransformer | 6 + .../bind/RequestAttributeArgumentBinder.java | 2 +- .../exchange/ExchangeControllerSpec.groovy | 94 ++++++++++++++ .../annotation/NestedGreetingController.java | 6 +- .../exchange/ExchangeGreetingApi.java | 57 +++++++++ .../exchange/ExchangeGreetingClient.java | 30 +++++ .../exchange/ExchangeGreetingController.java | 97 +++++++++++++++ .../guide/springToMicronaut/springMvc.adoc | 24 ++++ 15 files changed, 654 insertions(+), 10 deletions(-) create mode 100644 spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/DeleteExchangeAnnotationTransformer.java create mode 100644 spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/GetExchangeAnnotationTransformer.java create mode 100644 spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/HttpExchangeAnnotationTransformer.java create mode 100644 spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PatchExchangeAnnotationTransformer.java create mode 100644 spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PostExchangeAnnotationTransformer.java create mode 100644 spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PutExchangeAnnotationTransformer.java create mode 100644 spring-web/src/test/groovy/io/micronaut/spring/web/annotation/exchange/ExchangeControllerSpec.groovy create mode 100644 spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingApi.java create mode 100644 spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingClient.java create mode 100644 spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingController.java diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestMappingAnnotationTransformer.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestMappingAnnotationTransformer.java index 0e42cd5e8..955e8a61f 100644 --- a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestMappingAnnotationTransformer.java +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/RequestMappingAnnotationTransformer.java @@ -32,6 +32,7 @@ import io.micronaut.http.annotation.Produces; import io.micronaut.http.annotation.Put; import io.micronaut.http.annotation.Trace; +import io.micronaut.http.annotation.UriMapping; import io.micronaut.inject.annotation.NamedAnnotationTransformer; import io.micronaut.inject.visitor.VisitorContext; @@ -46,6 +47,7 @@ * @since 1.0 */ public class RequestMappingAnnotationTransformer implements NamedAnnotationTransformer { + @Override public String getName() { return "org.springframework.web.bind.annotation.RequestMapping"; @@ -67,8 +69,8 @@ protected boolean isHttpMethodMapping(@Nullable HttpMethod method) { * @return The builder */ protected @NonNull AnnotationValueBuilder newBuilder( - @Nullable HttpMethod httpMethod, - AnnotationValue annotation) { + @Nullable HttpMethod httpMethod, + AnnotationValue annotation) { if (httpMethod != null) { return switch (httpMethod) { @@ -80,15 +82,15 @@ protected boolean isHttpMethodMapping(@Nullable HttpMethod method) { case PUT -> AnnotationValue.builder(Put.class); case PATCH -> AnnotationValue.builder(Patch.class); case OPTIONS -> AnnotationValue.builder(Options.class); - default -> AnnotationValue.builder("io.micronaut.http.annotation.UriMapping"); + default -> AnnotationValue.builder(UriMapping.class); }; } else { - return AnnotationValue.builder("io.micronaut.http.annotation.UriMapping"); + return AnnotationValue.builder(UriMapping.class); } } private String computePath(AnnotationValue annotation) { - return annotation.stringValue().orElseGet(() -> annotation.stringValue("path").orElse("/")); + return annotation.stringValue().orElseGet(() -> annotation.stringValue("path").orElse(UriMapping.DEFAULT_URI)); } @Override @@ -101,11 +103,11 @@ public List> transform(AnnotationValue annotation annotations.add(newBuilder(method, annotation).value(path).build()); final String[] consumes = annotation.stringValues("consumes"); - final String[] produces = annotation.stringValues("produces"); - if (ArrayUtils.isNotEmpty(consumes)) { annotations.add(AnnotationValue.builder(Consumes.class).member("value", consumes).build()); } + + final String[] produces = annotation.stringValues("produces"); if (ArrayUtils.isNotEmpty(produces)) { annotations.add(AnnotationValue.builder(Produces.class).member("value", produces).build()); } diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/DeleteExchangeAnnotationTransformer.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/DeleteExchangeAnnotationTransformer.java new file mode 100644 index 000000000..dbf873dd7 --- /dev/null +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/DeleteExchangeAnnotationTransformer.java @@ -0,0 +1,43 @@ +/* + * Copyright 2017-2020 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation.exchange; + +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.AnnotationValueBuilder; +import io.micronaut.http.annotation.Delete; + +/** + * Maps Spring DeleteExchange to Micronaut. + * + * @since 5.10.0 + */ +public class DeleteExchangeAnnotationTransformer extends HttpExchangeAnnotationTransformer { + + @Override + public String getName() { + return "org.springframework.web.service.annotation.DeleteExchange"; + } + + @Override + protected AnnotationValueBuilder newBuilder(String httpMethod) { + return AnnotationValue.builder(Delete.class); + } + + @Override + protected boolean isHttpMethodMapping(String method) { + return true; + } +} diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/GetExchangeAnnotationTransformer.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/GetExchangeAnnotationTransformer.java new file mode 100644 index 000000000..a494bc2d8 --- /dev/null +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/GetExchangeAnnotationTransformer.java @@ -0,0 +1,43 @@ +/* + * Copyright 2017-2020 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation.exchange; + +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.AnnotationValueBuilder; +import io.micronaut.http.annotation.Get; + +/** + * Maps Spring GetExchange to Micronaut. + * + * @since 5.10.0 + */ +public class GetExchangeAnnotationTransformer extends HttpExchangeAnnotationTransformer { + + @Override + public String getName() { + return "org.springframework.web.service.annotation.GetExchange"; + } + + @Override + protected AnnotationValueBuilder newBuilder(String httpMethod) { + return AnnotationValue.builder(Get.class); + } + + @Override + protected boolean isHttpMethodMapping(String method) { + return true; + } +} diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/HttpExchangeAnnotationTransformer.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/HttpExchangeAnnotationTransformer.java new file mode 100644 index 000000000..524a5b32e --- /dev/null +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/HttpExchangeAnnotationTransformer.java @@ -0,0 +1,117 @@ +/* + * Copyright 2017-2024 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation.exchange; + +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.AnnotationValueBuilder; +import io.micronaut.core.annotation.NonNull; +import io.micronaut.core.annotation.Nullable; +import io.micronaut.core.util.ArrayUtils; +import io.micronaut.core.util.StringUtils; +import io.micronaut.http.annotation.Consumes; +import io.micronaut.http.annotation.Delete; +import io.micronaut.http.annotation.Get; +import io.micronaut.http.annotation.Head; +import io.micronaut.http.annotation.HttpMethodMapping; +import io.micronaut.http.annotation.Options; +import io.micronaut.http.annotation.Patch; +import io.micronaut.http.annotation.Post; +import io.micronaut.http.annotation.Produces; +import io.micronaut.http.annotation.Put; +import io.micronaut.http.annotation.Trace; +import io.micronaut.http.annotation.UriMapping; +import io.micronaut.inject.annotation.NamedAnnotationTransformer; +import io.micronaut.inject.visitor.VisitorContext; + +import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.List; + +/** + * Maps Spring HttpExchange to Micronaut. + * + * @since 5.10.0 + */ +public class HttpExchangeAnnotationTransformer implements NamedAnnotationTransformer { + + @Override + public String getName() { + return "org.springframework.web.service.annotation.HttpExchange"; + } + + /** + * Whether the given method is an HTTP method mapping. + * @param method The method, can be null + * @return True if it is + */ + protected boolean isHttpMethodMapping(@Nullable String method) { + return method != null; + } + + /** + * Construct a new builder for the given http method. + * @param method HTTP method + * @return The builder + */ + @NonNull + protected AnnotationValueBuilder newBuilder(String method) { + + if (method != null) { + return switch (method.toUpperCase()) { + case "GET" -> AnnotationValue.builder(Get.class); + case "POST" -> AnnotationValue.builder(Post.class); + case "PATCH" -> AnnotationValue.builder(Patch.class); + case "PUT" -> AnnotationValue.builder(Put.class); + case "DELETE" -> AnnotationValue.builder(Delete.class); + case "HEAD" -> AnnotationValue.builder(Head.class); + case "OPTIONS" -> AnnotationValue.builder(Options.class); + case "TRACE" -> AnnotationValue.builder(Trace.class); + default -> AnnotationValue.builder(UriMapping.class); + }; + } else { + return AnnotationValue.builder(UriMapping.class); + } + } + + private String computePath(AnnotationValue annotation) { + return annotation.stringValue().orElseGet(() -> annotation.stringValue("url").orElse(UriMapping.DEFAULT_URI)); + } + + @Override + public List> transform(AnnotationValue annotation, VisitorContext visitorContext) { + var annotations = new ArrayList>(); + + final String path = computePath(annotation); + var method = annotation.stringValue("method").orElse(null); + + annotations.add(newBuilder(method).value(path).build()); + + var contentType = annotation.stringValue("contentType").orElse(null); + if (StringUtils.isNotEmpty(contentType)) { + annotations.add(AnnotationValue.builder(Consumes.class).member("contentType", contentType).build()); + } + + final String[] accept = annotation.stringValues("accept"); + if (ArrayUtils.isNotEmpty(accept)) { + annotations.add(AnnotationValue.builder(Produces.class).member("value", accept).build()); + } + + if (isHttpMethodMapping(method)) { + annotations.add(AnnotationValue.builder(HttpMethodMapping.class).value(path).build()); + } + return annotations; + } +} diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PatchExchangeAnnotationTransformer.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PatchExchangeAnnotationTransformer.java new file mode 100644 index 000000000..0ade9f724 --- /dev/null +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PatchExchangeAnnotationTransformer.java @@ -0,0 +1,43 @@ +/* + * Copyright 2017-2020 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation.exchange; + +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.AnnotationValueBuilder; +import io.micronaut.http.annotation.Patch; + +/** + * Maps Spring PatchExchange to Micronaut. + * + * @since 5.10.0 + */ +public class PatchExchangeAnnotationTransformer extends HttpExchangeAnnotationTransformer { + + @Override + public String getName() { + return "org.springframework.web.service.annotation.PatchExchange"; + } + + @Override + protected AnnotationValueBuilder newBuilder(String httpMethod) { + return AnnotationValue.builder(Patch.class); + } + + @Override + protected boolean isHttpMethodMapping(String method) { + return true; + } +} diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PostExchangeAnnotationTransformer.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PostExchangeAnnotationTransformer.java new file mode 100644 index 000000000..3929f2566 --- /dev/null +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PostExchangeAnnotationTransformer.java @@ -0,0 +1,43 @@ +/* + * Copyright 2017-2020 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation.exchange; + +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.AnnotationValueBuilder; +import io.micronaut.http.annotation.Post; + +/** + * Maps Spring PostExchange to Micronaut. + * + * @since 5.10.0 + */ +public class PostExchangeAnnotationTransformer extends HttpExchangeAnnotationTransformer { + + @Override + public String getName() { + return "org.springframework.web.service.annotation.PostExchange"; + } + + @Override + protected AnnotationValueBuilder newBuilder(String httpMethod) { + return AnnotationValue.builder(Post.class); + } + + @Override + protected boolean isHttpMethodMapping(String method) { + return true; + } +} diff --git a/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PutExchangeAnnotationTransformer.java b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PutExchangeAnnotationTransformer.java new file mode 100644 index 000000000..ff5c0d48c --- /dev/null +++ b/spring-web-annotation/src/main/java/io/micronaut/spring/web/annotation/exchange/PutExchangeAnnotationTransformer.java @@ -0,0 +1,43 @@ +/* + * Copyright 2017-2020 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation.exchange; + +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.core.annotation.AnnotationValueBuilder; +import io.micronaut.http.annotation.Put; + +/** + * Maps Spring PutExchange to Micronaut. + * + * @since 5.10.0 + */ +public class PutExchangeAnnotationTransformer extends HttpExchangeAnnotationTransformer { + + @Override + public String getName() { + return "org.springframework.web.service.annotation.PutExchange"; + } + + @Override + protected AnnotationValueBuilder newBuilder(String httpMethod) { + return AnnotationValue.builder(Put.class); + } + + @Override + protected boolean isHttpMethodMapping(String method) { + return true; + } +} diff --git a/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationTransformer b/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationTransformer index 562e8a7e8..c00d11483 100644 --- a/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationTransformer +++ b/spring-web-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationTransformer @@ -4,3 +4,9 @@ io.micronaut.spring.web.annotation.PostMappingAnnotationTransformer io.micronaut.spring.web.annotation.PatchMappingAnnotationTransformer io.micronaut.spring.web.annotation.DeleteMappingAnnotationTransformer io.micronaut.spring.web.annotation.GetMappingAnnotationTransformer +io.micronaut.spring.web.annotation.exchange.HttpExchangeAnnotationTransformer +io.micronaut.spring.web.annotation.exchange.PutExchangeAnnotationTransformer +io.micronaut.spring.web.annotation.exchange.PostExchangeAnnotationTransformer +io.micronaut.spring.web.annotation.exchange.PatchExchangeAnnotationTransformer +io.micronaut.spring.web.annotation.exchange.DeleteExchangeAnnotationTransformer +io.micronaut.spring.web.annotation.exchange.GetExchangeAnnotationTransformer diff --git a/spring-web/src/main/java/io/micronaut/spring/web/bind/RequestAttributeArgumentBinder.java b/spring-web/src/main/java/io/micronaut/spring/web/bind/RequestAttributeArgumentBinder.java index da656acc0..baa19551e 100644 --- a/spring-web/src/main/java/io/micronaut/spring/web/bind/RequestAttributeArgumentBinder.java +++ b/spring-web/src/main/java/io/micronaut/spring/web/bind/RequestAttributeArgumentBinder.java @@ -48,7 +48,7 @@ public BindingResult bind(ArgumentConversionContext context, Htt annotationMetadata.getValue(RequestAttribute.class, "name", String.class).orElse(context.getArgument().getName()) ); - return new BindingResult() { + return new BindingResult<>() { @Override public Optional getValue() { return source.getAttributes().get(name, context); diff --git a/spring-web/src/test/groovy/io/micronaut/spring/web/annotation/exchange/ExchangeControllerSpec.groovy b/spring-web/src/test/groovy/io/micronaut/spring/web/annotation/exchange/ExchangeControllerSpec.groovy new file mode 100644 index 000000000..6e3fad001 --- /dev/null +++ b/spring-web/src/test/groovy/io/micronaut/spring/web/annotation/exchange/ExchangeControllerSpec.groovy @@ -0,0 +1,94 @@ +/* + * Copyright 2017-2024 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation.exchange + +import io.micronaut.http.HttpResponse +import io.micronaut.http.HttpStatus +import io.micronaut.spring.web.annotation.Greeting +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import jakarta.inject.Inject +import jakarta.validation.ConstraintViolationException +import spock.lang.Specification + +@MicronautTest +class ExchangeControllerSpec extends Specification { + + @Inject + ExchangeGreetingClient greetingClient + + void "test request controller"() { + expect: + greetingClient.home().contains("Welcome to Micronaut for Spring") + greetingClient.greeting("Fred").content == 'Hello, Fred!' + greetingClient.greetingNested("Fred").content == 'Hello Nested, Fred!' + greetingClient.greeting(null).content == 'Hello, World!' + greetingClient.greetingByPost(new Greeting(1, "Fred")).content == 'Hello, Fred!' + greetingClient.greetingWithStatus("Fred") + } + + void "test delete and response entity"() { + when: + HttpResponse response = greetingClient.deleteGreeting() + + then: + response.status() == HttpStatus.NO_CONTENT + response.header("Foo") == "Bar" + !response.header("myHeader") + + when: + var myHeaderValue = "myHeaderValue" + response = greetingClient.deleteGreeting(myHeaderValue) + + then: + response.status() == HttpStatus.NO_CONTENT + response.header("Foo") == "Bar" + response.header("myHeader") == myHeaderValue + } + + void "test request controller validation"() { + + when: + greetingClient.greeting("123").content == 'Hello, Fred!' + + then: + def e = thrown(ConstraintViolationException) + e.message.contains('greeting.name: must match "\\D+"') + } + + void "test ServerHttpRequest argument"() { + + when: + Greeting greeting = greetingClient.requestTest(new Greeting(1, "Fred")) + + then: + greeting != null + } + + void "test optional pathVar"() { + + when: + def responseForNull = greetingClient.withOptVar(null) + + then: + responseForNull == 'optVar is null!' + + when: + def response = greetingClient.withOptVar("This is path var") + + then: + response == 'Hello, This is path var!' + } +} diff --git a/spring-web/src/test/java/io/micronaut/spring/web/annotation/NestedGreetingController.java b/spring-web/src/test/java/io/micronaut/spring/web/annotation/NestedGreetingController.java index 1a697829d..caba760b0 100644 --- a/spring-web/src/test/java/io/micronaut/spring/web/annotation/NestedGreetingController.java +++ b/spring-web/src/test/java/io/micronaut/spring/web/annotation/NestedGreetingController.java @@ -24,12 +24,14 @@ @RestController @RequestMapping("/nested") public class NestedGreetingController { - private static final String template = "Hello Nested, %s!"; + + private static final String TEMPLATE = "Hello Nested, %s!"; + private final AtomicLong counter = new AtomicLong(); @RequestMapping("/greeting") public Greeting greeting(@RequestParam(value="name", defaultValue="World") String name) { return new Greeting(counter.incrementAndGet(), - String.format(template, name)); + String.format(TEMPLATE, name)); } } diff --git a/spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingApi.java b/spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingApi.java new file mode 100644 index 000000000..0a9608519 --- /dev/null +++ b/spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingApi.java @@ -0,0 +1,57 @@ +/* + * Copyright 2017-2024 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation.exchange; + +import io.micronaut.http.HttpResponse; +import io.micronaut.spring.web.annotation.Greeting; +import jakarta.annotation.Nullable; +import jakarta.validation.constraints.Pattern; +import org.springframework.http.HttpStatus; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.service.annotation.DeleteExchange; +import org.springframework.web.service.annotation.GetExchange; +import org.springframework.web.service.annotation.PostExchange; + +public interface ExchangeGreetingApi { + + @GetExchange + String home(@Nullable Model model); + + @GetExchange("/withOptVar{/optVar}") + String withOptVar(@PathVariable(required = false) String optVar); + + @GetExchange("/greeting2") + Greeting greeting(@RequestParam(value = "name", defaultValue = "World", required = false) @Pattern(regexp = "\\D+") String name); + + @PostExchange("/greeting") + Greeting greetingByPost(@RequestBody Greeting greeting); + + @DeleteExchange("/greeting") + HttpResponse deleteGreeting(@RequestHeader(required = false) String myHeader); + + @GetMapping("/greeting-status") + @ResponseStatus(code = HttpStatus.CREATED) + Greeting greetingWithStatus(@RequestParam(value = "name", defaultValue = "World") @Pattern(regexp = "\\D+") String name); + + @GetMapping("/nested/greeting{?name}") + Greeting greetingNested(@RequestParam(value = "name", defaultValue = "World") String name); +} diff --git a/spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingClient.java b/spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingClient.java new file mode 100644 index 000000000..4c83cebe5 --- /dev/null +++ b/spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingClient.java @@ -0,0 +1,30 @@ +/* + * Copyright 2017-2024 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation.exchange; + +import io.micronaut.http.annotation.Header; +import io.micronaut.http.client.annotation.Client; +import io.micronaut.spring.web.annotation.Greeting; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.service.annotation.PostExchange; + +@Client("/exchange") +public interface ExchangeGreetingClient extends ExchangeGreetingApi { + + @PostExchange("/request") + @Header(name = "Foo", value = "Bar") + Greeting requestTest(@RequestBody Greeting greeting); +} diff --git a/spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingController.java b/spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingController.java new file mode 100644 index 000000000..9d5133326 --- /dev/null +++ b/spring-web/src/test/java/io/micronaut/spring/web/annotation/exchange/ExchangeGreetingController.java @@ -0,0 +1,97 @@ +/* + * Copyright 2017-2024 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.web.annotation.exchange; + +import io.micronaut.http.HttpResponse; +import io.micronaut.spring.web.annotation.Greeting; +import jakarta.annotation.Nullable; +import org.springframework.http.HttpMethod; +import org.springframework.http.server.reactive.ServerHttpRequest; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.service.annotation.PostExchange; +import reactor.core.publisher.Flux; + +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.concurrent.atomic.AtomicLong; + +import static org.junit.Assert.assertEquals; + +@RestController +@RequestMapping("/exchange") +public class ExchangeGreetingController implements ExchangeGreetingApi { + + private static final String TEMPLATE_NESTED = "Hello Nested, %s!"; + private static final String TEMPLATE = "Hello, %s!"; + + private final AtomicLong counter = new AtomicLong(); + + @Override + public String home(@Nullable Model model) { + model.addAttribute("message", "Welcome to Micronaut for Spring!"); + return "welcome"; + } + + @Override + public String withOptVar(@Nullable String optVar) { + return optVar == null ? "optVar is null!" : String.format(TEMPLATE, optVar); + } + + @Override + public Greeting greeting(@Nullable String name) { + return new Greeting(counter.incrementAndGet(), TEMPLATE.formatted(name)); + } + + @Override + public Greeting greetingByPost(Greeting greeting) { + return new Greeting(counter.incrementAndGet(), TEMPLATE.formatted(greeting.getContent())); + } + + @Override + public HttpResponse deleteGreeting(@Nullable String myHeader) { + var headers = new HashMap(); + headers.put("Foo", "Bar"); + if (myHeader != null) { + headers.put("myHeader", myHeader); + } + return HttpResponse.noContent().headers(headers); + } + + @Override + public Greeting greetingWithStatus(String name) { + return new Greeting(counter.incrementAndGet(), TEMPLATE.formatted(name)); + } + + @Override + public Greeting greetingNested(String name) { + return new Greeting(counter.incrementAndGet(), String.format(TEMPLATE_NESTED, name)); + } + + @PostExchange("/request") + public Flux request(ServerHttpRequest request, HttpMethod method) { + assertEquals("/exchange/request", request.getPath().value()); + assertEquals(HttpMethod.POST, request.getMethod()); + assertEquals(HttpMethod.POST, method); + assertEquals("Bar", request.getHeaders().getFirst("Foo")); + return request.getBody().map(dataBuffer -> { + var bytes = new byte[dataBuffer.readableByteCount()]; + dataBuffer.read(bytes); + return new String(bytes, StandardCharsets.UTF_8); + }); + } +} diff --git a/src/main/docs/guide/springToMicronaut/springMvc.adoc b/src/main/docs/guide/springToMicronaut/springMvc.adoc index d5f118e92..e1df43020 100644 --- a/src/main/docs/guide/springToMicronaut/springMvc.adoc +++ b/src/main/docs/guide/springToMicronaut/springMvc.adoc @@ -58,6 +58,30 @@ The following Spring MVC annotations are supported: |link:{micronautapi}http/annotation/Controller.html[@Controller] |Example `@RestController` +|link:{springapi}org/springframework/web/service/annotation/HttpExchange.html[@HttpExchange] +|link:{micronautapi}http/annotation/UriMapping.html[@UriMapping] +|Example: `@HttpExchange("/foo/bar")` + + |link:{springapi}org/springframework/web/service/annotation/GetExchange.html[@GetExchange] +|link:{micronautapi}http/annotation/Get.html[@Get] +|Example: `@GetExchange("/foo/bar")` + +|link:{springapi}org/springframework/web/service/annotation/PostExchange.html[@PostExchange] +|link:{micronautapi}http/annotation/Post.html[@Post] +|Example: `@PostExchange("/foo/bar")` + +|link:{springapi}org/springframework/web/service/annotation/DeleteExchange.html[@DeleteExchange] +|link:{micronautapi}http/annotation/Delete.html[@Delete] +|Example: `@DeleteExchange("/foo/bar")` + +|link:{springapi}org/springframework/web/service/annotation/PatchExchange.html[@PatchExchange] +|link:{micronautapi}http/annotation/Patch.html[@Patch] +|Example: `@PatchExchange("/foo/bar")` + +|link:{springapi}org/springframework/web/service/annotation/PutExchange.html[@PutExchange] +|link:{micronautapi}http/annotation/Put.html[@Put] +|Example: `@PutExchange("/foo/bar")` + |link:{springapi}org/springframework/web/bind/annotation/RequestMapping.html[@RequestMapping] |link:{micronautapi}http/annotation/UriMapping.html[@UriMapping] |Example: `@RequestMapping("/foo/bar")` From 9e4566ab229dc9017313b3d7a9942c327ba1412c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:19:49 -0400 Subject: [PATCH 55/60] chore(deps): update plugin io.micronaut.build.shared.settings to v7.3.0 (#656) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- settings.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.gradle b/settings.gradle index e1ec833c4..1b24ea609 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,7 +6,7 @@ pluginManagement { } plugins { - id 'io.micronaut.build.shared.settings' version '7.2.3' + id 'io.micronaut.build.shared.settings' version '7.3.0' } rootProject.name = 'spring-parent' From b47b223821902385baa877b59318a88f6cd66d36 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:20:44 -0400 Subject: [PATCH 56/60] chore(deps): update dependency gradle to v8.11.1 (#650) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df97d72b8..e2847c820 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From bca8011b02924b17829df62bb13a450e15bee0bc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:15:28 +0100 Subject: [PATCH 57/60] chore(deps): update softprops/action-gh-release action to v2.1.0 (#654) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2dda05848..f0b8ad78a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -160,6 +160,6 @@ jobs: - name: Upload assets # Upload the artifacts to the existing release. Note that the SLSA provenance will # attest to each artifact file and not the aggregated ZIP file. - uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9 + uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0 with: files: artifacts.zip From 2fd56947df41f3c5ac496ceae13f24bf5688a91b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:15:41 +0100 Subject: [PATCH 58/60] chore(deps): update mikepenz/action-junit-report action to v5 (#644) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index e72393c34..22e563ad5 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -70,7 +70,7 @@ jobs: - name: "📊 Publish Test Report" if: always() - uses: mikepenz/action-junit-report@v4 + uses: mikepenz/action-junit-report@v5 with: check_name: Java CI / Test Report (${{ matrix.java }}) report_paths: '**/build/test-results/test/TEST-*.xml' From e636567b0657fc609e978952f39e3956df273cce Mon Sep 17 00:00:00 2001 From: micronaut-build <65172877+micronaut-build@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:16:01 +0100 Subject: [PATCH 59/60] Update common files (#659) --- .github/renovate.json | 22 +++++++++++++++------- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index 09c2a5983..99eeec105 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,24 +1,32 @@ { "extends": [ - "config:base" + "config:recommended" + ], + "addLabels": [ + "type: dependency-upgrade" ], - "addLabels": ["type: dependency-upgrade"], "schedule": [ - "after 10pm every day" + "after 10pm" ], "prHourlyLimit": 1, "prConcurrentLimit": 20, "timezone": "Europe/Prague", "packageRules": [ { - "matchPackagePatterns": ["actions.*"], "dependencyDashboardApproval": true, - "matchUpdateTypes": ["patch"], + "matchUpdateTypes": [ + "patch" + ], "matchCurrentVersion": "!/^0/", - "automerge": true + "automerge": true, + "matchPackageNames": [ + "/actions.*/" + ] }, { - "matchUpdateTypes": ["patch"], + "matchUpdateTypes": [ + "patch" + ], "matchCurrentVersion": "!/^0/", "automerge": true } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e2847c820..94113f200 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 135fb184d4025b0a82bcfbd7ba99f9755d641473 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:20:03 +0100 Subject: [PATCH 60/60] fix(deps): update spring core to v6.2.0 (#655) --- gradle/libs.versions.toml | 2 +- .../context/FallbackAnnotationMapper.java | 36 +++++++++++++++++++ ...cronaut.inject.annotation.AnnotationMapper | 3 +- .../context/MicronautApplicationContext.java | 5 +++ .../context/env/MicronautEnvironment.java | 5 +++ .../annotation/context/FallbackSpec.groovy | 15 ++++++++ .../spring/annotation/context/MyFallback.java | 7 ++++ .../annotation/context/MyInterface.java | 4 +++ .../annotation/context/MyInterfaceImpl.java | 9 +++++ .../springToMicronaut/springAnnotations.adoc | 4 +++ 10 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 spring-annotation/src/main/java/io/micronaut/spring/annotation/context/FallbackAnnotationMapper.java create mode 100644 spring-context/src/test/groovy/io/micronaut/spring/annotation/context/FallbackSpec.groovy create mode 100644 spring-context/src/test/java/io/micronaut/spring/annotation/context/MyFallback.java create mode 100644 spring-context/src/test/java/io/micronaut/spring/annotation/context/MyInterface.java create mode 100644 spring-context/src/test/java/io/micronaut/spring/annotation/context/MyInterfaceImpl.java diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 052f3eb92..8f99a69ad 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] managed-spring-boot = "3.4.0" -managed-spring = "6.1.14" +managed-spring = "6.2.0" groovy = "4.0.18" h2 = '2.3.232' diff --git a/spring-annotation/src/main/java/io/micronaut/spring/annotation/context/FallbackAnnotationMapper.java b/spring-annotation/src/main/java/io/micronaut/spring/annotation/context/FallbackAnnotationMapper.java new file mode 100644 index 000000000..b92db2d60 --- /dev/null +++ b/spring-annotation/src/main/java/io/micronaut/spring/annotation/context/FallbackAnnotationMapper.java @@ -0,0 +1,36 @@ +/* + * Copyright 2017-2024 original authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.micronaut.spring.annotation.context; + +import io.micronaut.context.annotation.Secondary; +import io.micronaut.core.annotation.AnnotationValue; +import io.micronaut.inject.annotation.TypedAnnotationMapper; +import io.micronaut.inject.visitor.VisitorContext; +import java.util.List; +import org.springframework.context.annotation.Fallback; + +public class FallbackAnnotationMapper + implements TypedAnnotationMapper { + @Override + public Class annotationType() { + return Fallback.class; + } + + @Override + public List> map(AnnotationValue annotation, VisitorContext visitorContext) { + return List.of(AnnotationValue.builder(Secondary.class).build()); + } +} diff --git a/spring-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationMapper b/spring-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationMapper index 5d171074d..0c31681cd 100644 --- a/spring-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationMapper +++ b/spring-annotation/src/main/resources/META-INF/services/io.micronaut.inject.annotation.AnnotationMapper @@ -2,6 +2,7 @@ io.micronaut.spring.annotation.context.ProfileAnnotationMapper io.micronaut.spring.annotation.context.QualifierAnnotationMapper io.micronaut.spring.annotation.context.BeanAnnotationMapper io.micronaut.spring.annotation.context.ComponentAnnotationMapper +io.micronaut.spring.annotation.context.FallbackAnnotationMapper io.micronaut.spring.annotation.context.RepositoryAnnotationMapper io.micronaut.spring.annotation.context.ServiceAnnotationMapper io.micronaut.spring.annotation.context.ConfigurationAnnotationMapper @@ -16,4 +17,4 @@ io.micronaut.spring.annotation.cache.CacheableAnnotationMapper io.micronaut.spring.annotation.cache.CachePutAnnotationMapper io.micronaut.spring.annotation.cache.CacheEvictAnnotationMapper io.micronaut.spring.annotation.tx.TransactionalAnnotationMapper -io.micronaut.spring.annotation.beans.ImportAnnotationMapper \ No newline at end of file +io.micronaut.spring.annotation.beans.ImportAnnotationMapper diff --git a/spring-context/src/main/java/io/micronaut/spring/context/MicronautApplicationContext.java b/spring-context/src/main/java/io/micronaut/spring/context/MicronautApplicationContext.java index 6145b6577..83d5fa3cc 100644 --- a/spring-context/src/main/java/io/micronaut/spring/context/MicronautApplicationContext.java +++ b/spring-context/src/main/java/io/micronaut/spring/context/MicronautApplicationContext.java @@ -441,6 +441,11 @@ public void close() { stop(); } + @Override + public boolean isClosed() { + return !this.micronautContext.isRunning(); + } + @Override public boolean isActive() { return isRunning(); diff --git a/spring-context/src/main/java/io/micronaut/spring/context/env/MicronautEnvironment.java b/spring-context/src/main/java/io/micronaut/spring/context/env/MicronautEnvironment.java index a114c8127..b413f8752 100644 --- a/spring-context/src/main/java/io/micronaut/spring/context/env/MicronautEnvironment.java +++ b/spring-context/src/main/java/io/micronaut/spring/context/env/MicronautEnvironment.java @@ -221,6 +221,11 @@ public void setValueSeparator(String valueSeparator) { throw new UnsupportedOperationException("Method setValueSeparator not supported"); } + @Override + public void setEscapeCharacter(Character escapeCharacter) { + throw new UnsupportedOperationException("Method setEscapeCharacter not supported"); + } + @Override public void setIgnoreUnresolvableNestedPlaceholders(boolean ignoreUnresolvableNestedPlaceholders) { throw new UnsupportedOperationException("Method setIgnoreUnresolvableNestedPlaceholders not supported"); diff --git a/spring-context/src/test/groovy/io/micronaut/spring/annotation/context/FallbackSpec.groovy b/spring-context/src/test/groovy/io/micronaut/spring/annotation/context/FallbackSpec.groovy new file mode 100644 index 000000000..d66fa0628 --- /dev/null +++ b/spring-context/src/test/groovy/io/micronaut/spring/annotation/context/FallbackSpec.groovy @@ -0,0 +1,15 @@ +package io.micronaut.spring.annotation.context + +import io.micronaut.context.ApplicationContext +import spock.lang.Specification + +class FallbackSpec extends Specification { + + void "test fallback works"() { + when: + def context = ApplicationContext.run() + + then: + context.getBean(MyInterface) instanceof MyFallback + } +} diff --git a/spring-context/src/test/java/io/micronaut/spring/annotation/context/MyFallback.java b/spring-context/src/test/java/io/micronaut/spring/annotation/context/MyFallback.java new file mode 100644 index 000000000..aafc134a2 --- /dev/null +++ b/spring-context/src/test/java/io/micronaut/spring/annotation/context/MyFallback.java @@ -0,0 +1,7 @@ +package io.micronaut.spring.annotation.context; + +import org.springframework.context.annotation.Fallback; + +@Fallback +public class MyFallback implements MyInterface { +} diff --git a/spring-context/src/test/java/io/micronaut/spring/annotation/context/MyInterface.java b/spring-context/src/test/java/io/micronaut/spring/annotation/context/MyInterface.java new file mode 100644 index 000000000..b972f23ae --- /dev/null +++ b/spring-context/src/test/java/io/micronaut/spring/annotation/context/MyInterface.java @@ -0,0 +1,4 @@ +package io.micronaut.spring.annotation.context; + +public interface MyInterface { +} diff --git a/spring-context/src/test/java/io/micronaut/spring/annotation/context/MyInterfaceImpl.java b/spring-context/src/test/java/io/micronaut/spring/annotation/context/MyInterfaceImpl.java new file mode 100644 index 000000000..a5421f824 --- /dev/null +++ b/spring-context/src/test/java/io/micronaut/spring/annotation/context/MyInterfaceImpl.java @@ -0,0 +1,9 @@ +package io.micronaut.spring.annotation.context; + +import io.micronaut.context.annotation.Requires; +import org.springframework.stereotype.Component; + +@Component +@Requires(property = "activation.property") +public class MyInterfaceImpl implements MyInterface { +} diff --git a/src/main/docs/guide/springToMicronaut/springAnnotations.adoc b/src/main/docs/guide/springToMicronaut/springAnnotations.adoc index 91466f402..f9d5f6138 100644 --- a/src/main/docs/guide/springToMicronaut/springAnnotations.adoc +++ b/src/main/docs/guide/springToMicronaut/springAnnotations.adoc @@ -50,6 +50,10 @@ The following table summarizes the annotations that Micronaut for Spring support |link:{micronautapi}context/annotation/Primary.html[@Primary] |Example `@Primary`. Requires `micronaut-context` dependency. +|link:{springapi}org/springframework/context/annotation/Fallback.html[@Fallback] +|link:{micronautapi}context/annotation/Secondary.html[@Secondary] +|Example `@Fallback`. Requires `micronaut-context` dependency. + |link:{springapi}org/springframework/context/event/EventListener.html[@EventListener] |link:{micronautapi}runtime/event/annotation/EventListener.html[@EventListener] |Example `@EventListener`. Requires `micronaut-inject` dependency.