From f0e25cbfc44da64af0ba35570d1c79bfcfbe5201 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:55:58 +0000 Subject: [PATCH 01/54] Bump org.avaje:java11-oss from 4.1 to 4.3 Bumps [org.avaje:java11-oss](https://github.com/avaje-pom/java11-oss) from 4.1 to 4.3. - [Release notes](https://github.com/avaje-pom/java11-oss/releases) - [Commits](https://github.com/avaje-pom/java11-oss/commits) --- updated-dependencies: - dependency-name: org.avaje:java11-oss dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a5f16b9e..722df381 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.avaje java11-oss - 4.1 + 4.3 io.avaje From aacb71f57628788a53be8b41b0c8d37cd7feafd5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:58:09 +0000 Subject: [PATCH 02/54] Bump io.avaje:avaje-prisms from 1.21 to 1.24 Bumps [io.avaje:avaje-prisms](https://github.com/avaje/avaje-prisms) from 1.21 to 1.24. - [Release notes](https://github.com/avaje/avaje-prisms/releases) - [Commits](https://github.com/avaje/avaje-prisms/compare/1.21...1.24) --- updated-dependencies: - dependency-name: io.avaje:avaje-prisms dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 722df381..65a399d6 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ true 2.2.22 2.14.2 - 1.21 + 1.24 ${project.build.directory}${file.separator}module-info.shade From 4005c280f938da409e94075548a83bd130c05b17 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:05:45 -0400 Subject: [PATCH 03/54] Update proc note (#447) --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bfe8803b..a4758515 100644 --- a/README.md +++ b/README.md @@ -47,17 +47,13 @@ Use source code generation to adapt annotated REST controllers `@Path, @Get, @Po ``` -### JDK 22+ +### JDK 23+ -In JDK 22+, annotation processors are disabled by default, you will need to add a flag to re-enable. +In JDK 23+, annotation processors are disabled by default, you will need to add a flag to re-enable. ```xml - - org.apache.maven.plugins - maven-compiler-plugin - - -proc:full - - + + full + ``` ## Define a Controller (These APT processors work with both Java and Kotlin) From 0619037ed2c5828faa3766c2e921b234411f42a2 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Fri, 14 Jun 2024 22:45:22 -0400 Subject: [PATCH 04/54] ea workflow --- .github/workflows/jdk-ea-stable.yml | 37 +++++++++++++++++++++++++++++ .github/workflows/jdk-ea.yml | 1 + 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/jdk-ea-stable.yml diff --git a/.github/workflows/jdk-ea-stable.yml b/.github/workflows/jdk-ea-stable.yml new file mode 100644 index 00000000..9e093d9a --- /dev/null +++ b/.github/workflows/jdk-ea-stable.yml @@ -0,0 +1,37 @@ + +name: JDK EA Stable + +on: + push: + pull_request: + workflow_dispatch: + schedule: + - cron: '39 1 * * 1,3,5' + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + - name: Set up Java + uses: oracle-actions/setup-java@v1 + with: + website: jdk.java.net + release: ea + version: stable + - name: Maven cache + uses: actions/cache@v3 + env: + cache-name: maven-cache + with: + path: + ~/.m2 + key: build-${{ env.cache-name }} + - name: Maven version + run: mvn --version + - name: Build with Maven + run: mvn clean verify package -Ptest diff --git a/.github/workflows/jdk-ea.yml b/.github/workflows/jdk-ea.yml index 6dec68f0..7e3cdc1e 100644 --- a/.github/workflows/jdk-ea.yml +++ b/.github/workflows/jdk-ea.yml @@ -2,6 +2,7 @@ name: avaje-http EA on: + pull_request: workflow_dispatch: schedule: - cron: '39 1 * * 2,5' From 1d5d2c5f9f8f2f0bbdb989740b073fa5a849edb8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 19:01:30 +0000 Subject: [PATCH 05/54] Bump nima.version from 4.0.9 to 4.0.10 Bumps `nima.version` from 4.0.9 to 4.0.10. Updates `io.helidon.webserver:helidon-webserver` from 4.0.9 to 4.0.10 Updates `io.helidon.http.media:helidon-http-media-jsonb` from 4.0.9 to 4.0.10 --- updated-dependencies: - dependency-name: io.helidon.webserver:helidon-webserver dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.helidon.http.media:helidon-http-media-jsonb dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pom.xml b/tests/pom.xml index 61d79f2b..b9d3ba29 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -17,7 +17,7 @@ 2.17.1 2.5 9.12 - 4.0.9 + 4.0.10 6.1.6 From 6a79172c23b92ec2b992df791ea02f36f0855018 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 19:47:22 +0000 Subject: [PATCH 06/54] [workflow]: Bump actions/cache from 3 to 4 Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/jdk-ea-stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jdk-ea-stable.yml b/.github/workflows/jdk-ea-stable.yml index 9e093d9a..c28613f5 100644 --- a/.github/workflows/jdk-ea-stable.yml +++ b/.github/workflows/jdk-ea-stable.yml @@ -24,7 +24,7 @@ jobs: release: ea version: stable - name: Maven cache - uses: actions/cache@v3 + uses: actions/cache@v4 env: cache-name: maven-cache with: From 9600094c9d04dadf142cf2f9256f6c27736daf58 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 19:49:27 +0000 Subject: [PATCH 07/54] [workflow]: Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/jdk-ea-stable.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/jdk-ea-stable.yml b/.github/workflows/jdk-ea-stable.yml index c28613f5..a6c44f00 100644 --- a/.github/workflows/jdk-ea-stable.yml +++ b/.github/workflows/jdk-ea-stable.yml @@ -16,7 +16,7 @@ jobs: packages: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Java uses: oracle-actions/setup-java@v1 with: From 38370c20cb7a700ca193128788b86e749615530b Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Thu, 20 Jun 2024 21:43:39 +1200 Subject: [PATCH 08/54] #452 The generator does not work when using @Produces to customize the JSON MIME type (#454) * #452 - The generator does not work when using `@Produces` to customize the JSON MIME type e.g. ``` @Produces(MediaType.APPLICATION_JSON + ";charset=UTF-8") ``` * #452 - The generator does not work when using `@Produces` to customize the JSON MIME type e.g. ``` @Produces(MediaType.APPLICATION_JSON + ";charset=UTF-8") ``` --- .../avaje/http/generator/core/JsonBUtil.java | 7 +++++- .../javalin/ControllerMethodWriter.java | 25 ++++++++++--------- .../generator/jex/ControllerMethodWriter.java | 9 +++---- .../example/myapp/web/HelloController.java | 1 + .../src/main/resources/public/openapi.json | 8 +++--- .../example/myapp/web/HelloController.java | 1 + .../src/main/resources/public/openapi.json | 2 +- 7 files changed, 29 insertions(+), 24 deletions(-) diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/JsonBUtil.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/JsonBUtil.java index a47923fe..212600c9 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/JsonBUtil.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/JsonBUtil.java @@ -5,9 +5,14 @@ import java.util.function.Consumer; import java.util.stream.Collectors; -public class JsonBUtil { +public final class JsonBUtil { + private JsonBUtil() {} + public static boolean isJsonMimeType(String producesMimeType) { + return producesMimeType == null || producesMimeType.toLowerCase().contains("application/json"); + } + public static Map jsonTypes(ControllerReader reader) { final Map jsonTypes = new LinkedHashMap<>(); diff --git a/http-generator-javalin/src/main/java/io/avaje/http/generator/javalin/ControllerMethodWriter.java b/http-generator-javalin/src/main/java/io/avaje/http/generator/javalin/ControllerMethodWriter.java index 3cda0612..799d6776 100644 --- a/http-generator-javalin/src/main/java/io/avaje/http/generator/javalin/ControllerMethodWriter.java +++ b/http-generator-javalin/src/main/java/io/avaje/http/generator/javalin/ControllerMethodWriter.java @@ -4,14 +4,7 @@ import java.util.List; -import io.avaje.http.generator.core.Append; -import io.avaje.http.generator.core.CoreWebMethod; -import io.avaje.http.generator.core.MethodParam; -import io.avaje.http.generator.core.MethodReader; -import io.avaje.http.generator.core.PathSegments; -import io.avaje.http.generator.core.UType; -import io.avaje.http.generator.core.Util; -import io.avaje.http.generator.core.WebMethod; +import io.avaje.http.generator.core.*; import io.avaje.http.generator.core.openapi.MediaType; /** Write code to register Web route for a given controller method. */ @@ -158,8 +151,9 @@ private void writeContextReturn() { } private void writeContextReturn(final String resultVariableName) { - final var produces = method.produces(); - if (produces == null || MediaType.APPLICATION_JSON.getValue().equalsIgnoreCase(produces)) { + var produces = method.produces(); + boolean applicationJson = produces == null || MediaType.APPLICATION_JSON.getValue().equalsIgnoreCase(produces); + if (applicationJson || JsonBUtil.isJsonMimeType(produces)) { if (useJsonB) { var uType = UType.parse(method.returnType()); final boolean isfuture = "java.util.concurrent.CompletableFuture".equals(uType.mainType()); @@ -169,12 +163,19 @@ private void writeContextReturn(final String resultVariableName) { } writer.append(" try {"); } - writer.append(" %sJsonType.toJson(%s, ctx.contentType(\"application/json\").res().getOutputStream());", uType.shortName(), resultVariableName); + if (produces == null) { + produces = MediaType.APPLICATION_JSON.getValue(); + } + writer.append(" %sJsonType.toJson(%s, ctx.contentType(\"%s\").res().getOutputStream());", uType.shortName(), resultVariableName, produces); if (isfuture || method.isErrorMethod()) { writer.append(" } catch (java.io.IOException e) { throw new java.io.UncheckedIOException(e); }"); } } else { - writer.append(" ctx.json(%s);", resultVariableName); + if (applicationJson) { + writer.append(" ctx.json(%s);", resultVariableName); + } else { + writer.append(" ctx.contentType(\"%s\").json(%s);", produces, resultVariableName); + } } } else if (MediaType.TEXT_HTML.getValue().equalsIgnoreCase(produces)) { writer.append(" ctx.html(%s);", resultVariableName); diff --git a/http-generator-jex/src/main/java/io/avaje/http/generator/jex/ControllerMethodWriter.java b/http-generator-jex/src/main/java/io/avaje/http/generator/jex/ControllerMethodWriter.java index dc663e29..da6d99a8 100644 --- a/http-generator-jex/src/main/java/io/avaje/http/generator/jex/ControllerMethodWriter.java +++ b/http-generator-jex/src/main/java/io/avaje/http/generator/jex/ControllerMethodWriter.java @@ -3,12 +3,7 @@ import static io.avaje.http.generator.core.ProcessingContext.platform; import java.util.List; -import io.avaje.http.generator.core.Append; -import io.avaje.http.generator.core.MethodParam; -import io.avaje.http.generator.core.MethodReader; -import io.avaje.http.generator.core.PathSegments; -import io.avaje.http.generator.core.Util; -import io.avaje.http.generator.core.WebMethod; +import io.avaje.http.generator.core.*; import io.avaje.http.generator.core.openapi.MediaType; /** @@ -102,6 +97,8 @@ private void writeContextReturn() { writer.append("ctx.html("); } else if (produces.equalsIgnoreCase(MediaType.TEXT_PLAIN.getValue())) { writer.append("ctx.text("); + } else if (JsonBUtil.isJsonMimeType(produces)) { + writer.append("ctx.contentType(\"%s\").json(", produces); } else { writer.append("ctx.contentType(\"%s\").write(", produces); } diff --git a/tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/HelloController.java b/tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/HelloController.java index a918215e..18f4df26 100644 --- a/tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/HelloController.java +++ b/tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/HelloController.java @@ -82,6 +82,7 @@ List findByName(String name, @QueryParam("my-param") @Default("one") S /** * Simple example post with JSON body response. */ + @Produces(MediaType.APPLICATION_JSON_PATCH_JSON) @Post HelloDto post(HelloDto dto) { dto.name = "posted"; diff --git a/tests/test-javalin-jsonb/src/main/resources/public/openapi.json b/tests/test-javalin-jsonb/src/main/resources/public/openapi.json index 087e3dd8..bb9b03bd 100644 --- a/tests/test-javalin-jsonb/src/main/resources/public/openapi.json +++ b/tests/test-javalin-jsonb/src/main/resources/public/openapi.json @@ -1,7 +1,7 @@ { "openapi" : "3.0.1", "info" : { - "title" : "Example service showing off the Path extension method of controller", + "title" : "Example service", "description" : "Example Javalin controllers with Java and Maven", "version" : "" }, @@ -14,11 +14,11 @@ "tags" : [ { "name" : "tag1", - "description" : "this is added to openapi tags" + "description" : "it's somethin" }, { "name" : "tag1", - "description" : "it's somethin" + "description" : "this is added to openapi tags" } ], "paths" : { @@ -320,7 +320,7 @@ "201" : { "description" : "", "content" : { - "application/json" : { + "application/json-patch+json" : { "schema" : { "$ref" : "#/components/schemas/HelloDto" } diff --git a/tests/test-javalin/src/main/java/org/example/myapp/web/HelloController.java b/tests/test-javalin/src/main/java/org/example/myapp/web/HelloController.java index 4ddd454b..bfad1c72 100644 --- a/tests/test-javalin/src/main/java/org/example/myapp/web/HelloController.java +++ b/tests/test-javalin/src/main/java/org/example/myapp/web/HelloController.java @@ -82,6 +82,7 @@ List findByName(String name, @QueryParam("my-param") @Default("one") S /** * Simple example post with JSON body response. */ + @Produces(MediaType.APPLICATION_JSON + ";charset=UTF-8") @Post HelloDto post(HelloDto dto) { dto.name = "posted"; diff --git a/tests/test-javalin/src/main/resources/public/openapi.json b/tests/test-javalin/src/main/resources/public/openapi.json index ff158eb0..76a5ad5b 100644 --- a/tests/test-javalin/src/main/resources/public/openapi.json +++ b/tests/test-javalin/src/main/resources/public/openapi.json @@ -310,7 +310,7 @@ "201" : { "description" : "", "content" : { - "application/json" : { + "application/json;charset=UTF-8" : { "schema" : { "$ref" : "#/components/schemas/HelloDto" } From b885da362e57f1d5040f9750c5c4d326ba6aeb88 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Thu, 20 Jun 2024 22:19:27 +1200 Subject: [PATCH 09/54] #453 - Compile error with nested enum type not imported in generated server code (#455) e.g. ``` public class Foo { public enum NestedEnum { A, B, C } } ``` ``` @Controller class TestController { @Post void foo(Foo.NestedEnum value) { System.out.println(value); } ``` --- .../io/avaje/http/generator/core/TypeMap.java | 4 +-- .../io/avaje/http/generator/core/UType.java | 12 +++++++ .../avaje/http/generator/core/UTypeTest.java | 9 +++++ .../example/myapp/web/HelloController.java | 7 ++++ .../java/org/example/myapp/web/other/Foo.java | 7 ++++ .../src/main/resources/public/openapi.json | 35 +++++++++++++++++++ 6 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/other/Foo.java diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/TypeMap.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/TypeMap.java index 1594766f..037b6950 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/TypeMap.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/TypeMap.java @@ -316,12 +316,12 @@ static class EnumHandler extends ObjectHandler { @Override public String toMethod() { - return "(" + type.shortType() + ") toEnum(" + type.shortType() + ".class, "; + return "(" + type.shortTypeNested() + ") toEnum(" + type.shortTypeNested() + ".class, "; } @Override public String asMethod() { - return "(" + type.shortType() + ") asEnum(" + type.shortType() + ".class, "; + return "(" + type.shortTypeNested() + ") asEnum(" + type.shortTypeNested() + ".class, "; } } diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/UType.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/UType.java index f22658b2..24738fdb 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/UType.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/UType.java @@ -31,6 +31,13 @@ static UType parse(String type) { */ String shortType(); + /** + * Return the short type taking nested type into account. + */ + default String shortTypeNested() { + return shortType(); + } + /** * Return the short name. */ @@ -152,6 +159,11 @@ public String shortType() { return Util.shortName(rawType); } + @Override + public String shortTypeNested() { + return Util.shortName(rawType, true); + } + @Override public String shortName() { return Util.initLower(shortType()).replace(".", "$"); diff --git a/http-generator-core/src/test/java/io/avaje/http/generator/core/UTypeTest.java b/http-generator-core/src/test/java/io/avaje/http/generator/core/UTypeTest.java index 12dea5d6..51e79c70 100644 --- a/http-generator-core/src/test/java/io/avaje/http/generator/core/UTypeTest.java +++ b/http-generator-core/src/test/java/io/avaje/http/generator/core/UTypeTest.java @@ -2,6 +2,7 @@ import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; class UTypeTest { @@ -17,4 +18,12 @@ void isJavaLangPackage_expect_false() { assertFalse(UType.isJavaLangPackage("java.lang.other.Foo")); assertFalse(UType.isJavaLangPackage("not.lang.Foo")); } + + @Test + void parseNestedEnum() { + UType uType = UType.parse("my.pack.Foo.NestedEnum"); + assertThat(uType.mainType()).isEqualTo("my.pack.Foo.NestedEnum"); + assertThat(uType.shortType()).isEqualTo("Foo.NestedEnum"); + assertThat(uType.shortTypeNested()).isEqualTo("NestedEnum"); + } } diff --git a/tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/HelloController.java b/tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/HelloController.java index 18f4df26..fb6d8ecf 100644 --- a/tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/HelloController.java +++ b/tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/HelloController.java @@ -25,6 +25,7 @@ import io.javalin.http.Context; import io.swagger.v3.oas.annotations.Hidden; import jakarta.inject.Inject; +import org.example.myapp.web.other.Foo; /** * Hello resource manager. @@ -183,4 +184,10 @@ String controlStatusCode(Context ctx) { ctx.status(201); return "controlStatusCode"; } + + @Produces(value = "text/plain") + @Get("takesNestedEnum") + String takesNestedEnum(Foo.NestedEnum myEnum) { + return "takesNestedEnum-" + myEnum; + } } diff --git a/tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/other/Foo.java b/tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/other/Foo.java new file mode 100644 index 00000000..f3ed0507 --- /dev/null +++ b/tests/test-javalin-jsonb/src/main/java/org/example/myapp/web/other/Foo.java @@ -0,0 +1,7 @@ +package org.example.myapp.web.other; + +public class Foo { + public enum NestedEnum { + A, B, C + } +} diff --git a/tests/test-javalin-jsonb/src/main/resources/public/openapi.json b/tests/test-javalin-jsonb/src/main/resources/public/openapi.json index bb9b03bd..549828b2 100644 --- a/tests/test-javalin-jsonb/src/main/resources/public/openapi.json +++ b/tests/test-javalin-jsonb/src/main/resources/public/openapi.json @@ -646,6 +646,41 @@ } } }, + "/hello/takesNestedEnum" : { + "get" : { + "tags" : [ + + ], + "summary" : "", + "description" : "", + "parameters" : [ + { + "name" : "myEnum", + "in" : "query", + "schema" : { + "type" : "string", + "enum" : [ + "A", + "B", + "C" + ] + } + } + ], + "responses" : { + "200" : { + "description" : "", + "content" : { + "text/plain" : { + "schema" : { + "type" : "string" + } + } + } + } + } + } + }, "/hello/withMatrix/{year_segment}/{other}" : { "get" : { "tags" : [ From 5c2ee0dc146a06ea9e964996cb9bfda76a4b6467 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Thu, 20 Jun 2024 22:25:54 +1200 Subject: [PATCH 10/54] Version 2.6-RC2 --- http-api-javalin/pom.xml | 2 +- http-api/pom.xml | 2 +- http-client-gson-adapter/pom.xml | 4 ++-- http-client-moshi-adapter/pom.xml | 4 ++-- http-client/pom.xml | 4 ++-- http-generator-client/pom.xml | 2 +- http-generator-core/pom.xml | 2 +- http-generator-helidon/pom.xml | 2 +- http-generator-javalin/pom.xml | 2 +- http-generator-jex/pom.xml | 2 +- http-inject-plugin/pom.xml | 2 +- pom.xml | 2 +- tests/pom.xml | 2 +- tests/test-client-generation/pom.xml | 2 +- tests/test-client/pom.xml | 2 +- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-javalin/pom.xml | 2 +- tests/test-jex/pom.xml | 2 +- tests/test-nima-jsonb/pom.xml | 2 +- tests/test-nima/pom.xml | 2 +- 20 files changed, 23 insertions(+), 23 deletions(-) diff --git a/http-api-javalin/pom.xml b/http-api-javalin/pom.xml index f38b8839..afc54dfe 100644 --- a/http-api-javalin/pom.xml +++ b/http-api-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC1 + 2.6-RC2 .. diff --git a/http-api/pom.xml b/http-api/pom.xml index 704fb8d1..83427c7e 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC1 + 2.6-RC2 .. diff --git a/http-client-gson-adapter/pom.xml b/http-client-gson-adapter/pom.xml index a2c4ff1d..2f35cbb0 100644 --- a/http-client-gson-adapter/pom.xml +++ b/http-client-gson-adapter/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC1 + 2.6-RC2 avaje-http-client-gson @@ -20,7 +20,7 @@ io.avaje avaje-http-client - 2.6-RC1 + 2.6-RC2 provided diff --git a/http-client-moshi-adapter/pom.xml b/http-client-moshi-adapter/pom.xml index 93173772..99ecf68a 100644 --- a/http-client-moshi-adapter/pom.xml +++ b/http-client-moshi-adapter/pom.xml @@ -3,7 +3,7 @@ io.avaje avaje-http-parent - 2.6-RC1 + 2.6-RC2 avaje-http-client-moshi @@ -19,7 +19,7 @@ io.avaje avaje-http-client - 2.6-RC1 + 2.6-RC2 provided diff --git a/http-client/pom.xml b/http-client/pom.xml index 7144e47f..d6e8df72 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC1 + 2.6-RC2 avaje-http-client @@ -66,7 +66,7 @@ io.avaje avaje-http-api - 2.6-RC1 + 2.6-RC2 test diff --git a/http-generator-client/pom.xml b/http-generator-client/pom.xml index 305f4aa6..316cc747 100644 --- a/http-generator-client/pom.xml +++ b/http-generator-client/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC1 + 2.6-RC2 avaje-http-client-generator diff --git a/http-generator-core/pom.xml b/http-generator-core/pom.xml index 31194e09..7acd999a 100644 --- a/http-generator-core/pom.xml +++ b/http-generator-core/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC1 + 2.6-RC2 avaje-http-generator-core diff --git a/http-generator-helidon/pom.xml b/http-generator-helidon/pom.xml index 0494b1da..bf1e98bf 100644 --- a/http-generator-helidon/pom.xml +++ b/http-generator-helidon/pom.xml @@ -4,7 +4,7 @@ avaje-http-parent io.avaje - 2.6-RC1 + 2.6-RC2 avaje-http-helidon-generator diff --git a/http-generator-javalin/pom.xml b/http-generator-javalin/pom.xml index ea9a6ae7..1fbd7a61 100644 --- a/http-generator-javalin/pom.xml +++ b/http-generator-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC1 + 2.6-RC2 avaje-http-javalin-generator diff --git a/http-generator-jex/pom.xml b/http-generator-jex/pom.xml index 787b49ac..27295f6c 100644 --- a/http-generator-jex/pom.xml +++ b/http-generator-jex/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC1 + 2.6-RC2 avaje-http-jex-generator diff --git a/http-inject-plugin/pom.xml b/http-inject-plugin/pom.xml index fc8de7fa..208214ea 100644 --- a/http-inject-plugin/pom.xml +++ b/http-inject-plugin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC1 + 2.6-RC2 .. diff --git a/pom.xml b/pom.xml index 65a399d6..38b391f5 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ io.avaje avaje-http-parent - 2.6-RC1 + 2.6-RC2 pom diff --git a/tests/pom.xml b/tests/pom.xml index b9d3ba29..7f729efd 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -4,7 +4,7 @@ avaje-http-parent io.avaje - 2.6-RC1 + 2.6-RC2 tests diff --git a/tests/test-client-generation/pom.xml b/tests/test-client-generation/pom.xml index 049ff4b3..fa354fd4 100644 --- a/tests/test-client-generation/pom.xml +++ b/tests/test-client-generation/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.6-RC1 + 2.6-RC2 test-client-generation diff --git a/tests/test-client/pom.xml b/tests/test-client/pom.xml index d2d60d9d..9d42f0bb 100644 --- a/tests/test-client/pom.xml +++ b/tests/test-client/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.6-RC1 + 2.6-RC2 test-client diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index f45031ff..2978328b 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -5,7 +5,7 @@ io.avaje tests - 2.6-RC1 + 2.6-RC2 test-javalin-jsonb diff --git a/tests/test-javalin/pom.xml b/tests/test-javalin/pom.xml index 6307622f..eb7d58c5 100644 --- a/tests/test-javalin/pom.xml +++ b/tests/test-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.6-RC1 + 2.6-RC2 test-javalin diff --git a/tests/test-jex/pom.xml b/tests/test-jex/pom.xml index 70714c85..d13b2502 100644 --- a/tests/test-jex/pom.xml +++ b/tests/test-jex/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.6-RC1 + 2.6-RC2 test-jex diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 6b9f309a..12d29b7d 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.6-RC1 + 2.6-RC2 test-nima-jsonb diff --git a/tests/test-nima/pom.xml b/tests/test-nima/pom.xml index 3a909037..2d9680a6 100644 --- a/tests/test-nima/pom.xml +++ b/tests/test-nima/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.6-RC1 + 2.6-RC2 test-nima From e477f136887898fc63a643684149d85da2964797 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Mon, 24 Jun 2024 04:37:07 -0400 Subject: [PATCH 11/54] Use avaje spi for service validation when available (#456) * use avaje spi for service validation if possible * Update pom.xml * Format changes only --------- Co-authored-by: Rob Bygrave --- .../generator/client/ClientProcessor.java | 7 +- .../http/generator/core/BaseProcessor.java | 9 ++- .../generator/core/ProcessingContext.java | 78 +++++++++---------- pom.xml | 2 +- 4 files changed, 50 insertions(+), 46 deletions(-) diff --git a/http-generator-client/src/main/java/io/avaje/http/generator/client/ClientProcessor.java b/http-generator-client/src/main/java/io/avaje/http/generator/client/ClientProcessor.java index bfa89414..2ba48724 100644 --- a/http-generator-client/src/main/java/io/avaje/http/generator/client/ClientProcessor.java +++ b/http-generator-client/src/main/java/io/avaje/http/generator/client/ClientProcessor.java @@ -17,6 +17,7 @@ import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; +import io.avaje.http.generator.core.APContext; import io.avaje.http.generator.core.ClientPrism; import io.avaje.http.generator.core.ControllerReader; import io.avaje.http.generator.core.ImportPrism; @@ -44,6 +45,7 @@ public SourceVersion getSupportedSourceVersion() { public synchronized void init(ProcessingEnvironment processingEnv) { super.init(processingEnv); this.processingEnv = processingEnv; + APContext.init(processingEnv); ProcessingContext.init(processingEnv, new ClientPlatformAdapter(), false); this.componentWriter = new SimpleComponentWriter(metaData); useJsonB = ProcessingContext.useJsonb(); @@ -51,7 +53,7 @@ public synchronized void init(ProcessingEnvironment processingEnv) { @Override public boolean process(Set annotations, RoundEnvironment round) { - ProcessingContext.findModule(annotations, round); + APContext.setProjectModuleElement(annotations, round); final var platform = platform(); if (!(platform instanceof ClientPlatformAdapter)) { setPlatform(new ClientPlatformAdapter()); @@ -107,7 +109,8 @@ protected String writeClientAdapter(ControllerReader reader) throws IOException private void initialiseComponent() { metaData.initialiseFullName(); if (!metaData.all().isEmpty()) { - ProcessingContext.validateModule(metaData.fullName()); + ProcessingContext.addClientComponent(metaData.fullName()); + ProcessingContext.validateModule(); } try { componentWriter.init(); diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/BaseProcessor.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/BaseProcessor.java index 595014b7..485835fa 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/BaseProcessor.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/BaseProcessor.java @@ -22,6 +22,11 @@ import javax.lang.model.element.TypeElement; import javax.lang.model.util.ElementFilter; +import io.avaje.prism.GenerateAPContext; +import io.avaje.prism.GenerateModuleInfoReader; + +@GenerateAPContext +@GenerateModuleInfoReader @SupportedOptions({"useJavax", "useSingleton", "instrumentRequests","disableDirectWrites"}) public abstract class BaseProcessor extends AbstractProcessor { @@ -42,6 +47,7 @@ public Set getSupportedAnnotationTypes() { @Override public synchronized void init(ProcessingEnvironment processingEnv) { super.init(processingEnv); + APContext.init(processingEnv); ProcessingContext.init(processingEnv, providePlatformAdapter()); } @@ -51,7 +57,7 @@ public synchronized void init(ProcessingEnvironment processingEnv) { @Override public boolean process(Set annotations, RoundEnvironment round) { var pathElements = round.getElementsAnnotatedWith(typeElement(PathPrism.PRISM_TYPE)); - + APContext.setProjectModuleElement(annotations, round); if (contextPathString == null) { contextPathString = ElementFilter.modulesIn(pathElements).stream() @@ -79,6 +85,7 @@ public boolean process(Set annotations, RoundEnvironment if (round.processingOver()) { writeOpenAPI(); + ProcessingContext.validateModule(); } return false; } diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/ProcessingContext.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/ProcessingContext.java index f99a34b1..6cab59ba 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/ProcessingContext.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/ProcessingContext.java @@ -1,22 +1,17 @@ package io.avaje.http.generator.core; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStreamReader; import java.net.URI; import java.nio.file.Paths; -import java.util.Collection; import java.util.List; import java.util.Objects; import java.util.Optional; -import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.processing.Filer; import javax.annotation.processing.Messager; import javax.annotation.processing.ProcessingEnvironment; -import javax.annotation.processing.RoundEnvironment; import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.ModuleElement; @@ -31,6 +26,7 @@ import javax.tools.JavaFileObject; import javax.tools.StandardLocation; +import io.avaje.http.generator.core.ModuleInfoReader.Provides; import io.avaje.http.generator.core.openapi.DocContext; public final class ProcessingContext { @@ -53,8 +49,9 @@ private static final class Ctx { private final boolean instrumentAllMethods; private final boolean disableDirectWrites; private final boolean javalin6; - private ModuleElement module; + private final boolean spiPresent = APContext.typeElement("io.avaje.spi.internal.ServiceProcessor") != null; private boolean validated; + private String clientFQN; Ctx(ProcessingEnvironment env, PlatformAdapter adapter, boolean generateOpenAPI) { readAdapter = adapter; @@ -146,7 +143,12 @@ public static JavaFileObject createWriter(String cls, Element origin) throws IOE /** Create a file writer for the META-INF services file. */ public static FileObject createMetaInfWriter(String target) throws IOException { - return CTX.get().filer.createResource(StandardLocation.CLASS_OUTPUT, "", target); + var serviceFile = + CTX.get().spiPresent + ? target.replace("META-INF/services/", "META-INF/generated-services/") + : target; + + return filer().createResource(StandardLocation.CLASS_OUTPUT, "", serviceFile); } public static JavaFileObject createWriter(String cls) throws IOException { @@ -175,7 +177,7 @@ public static List superMethods(Element element, String metho .filter(type -> !type.toString().contains("java.lang.Object")) .map(superType -> { final var superClass = (TypeElement) types.asElement(superType); - for (final ExecutableElement method : ElementFilter.methodsIn(CTX.get().elementUtils.getAllMembers(superClass))) { + for (final var method : ElementFilter.methodsIn(CTX.get().elementUtils.getAllMembers(superClass))) { if (method.getSimpleName().contentEquals(methodName)) { return method; } @@ -231,45 +233,33 @@ public static boolean isAssignable2Interface(String type, String superType) { static Stream superTypes(Element element) { final Types types = CTX.get().typeUtils; return types.directSupertypes(element.asType()).stream() - .filter(type -> !type.toString().contains("java.lang.Object")) - .map(superType -> (TypeElement) types.asElement(superType)) - .flatMap(e -> Stream.concat(superTypes(e), Stream.of(e))) - .map(Object::toString); - } - - public static void findModule(Set annotations, RoundEnvironment roundEnv) { - if (CTX.get().module == null) { - CTX.get().module = - annotations.stream() - .map(roundEnv::getElementsAnnotatedWith) - .flatMap(Collection::stream) - .findAny() - .map(ProcessingContext::getModuleElement) - .orElse(null); - } + .filter(type -> !type.toString().contains("java.lang.Object")) + .map(superType -> (TypeElement) types.asElement(superType)) + .flatMap(e -> Stream.concat(superTypes(e), Stream.of(e))) + .map(Object::toString); } - public static void validateModule(String fqn) { - var module = CTX.get().module; + public static void validateModule() { + var module = APContext.getProjectModuleElement(); if (module != null && !CTX.get().validated && !module.isUnnamed()) { - CTX.get().validated = true; - try (var inputStream = - CTX.get() - .filer - .getResource(StandardLocation.SOURCE_PATH, "", "module-info.java") - .toUri() - .toURL() - .openStream(); - var reader = new BufferedReader(new InputStreamReader(inputStream))) { - - var noProvides = reader.lines().map(s -> { - if (s.contains("io.avaje.http.api.javalin") && !s.contains("static")) { - logWarn("io.avaje.http.api.javalin only contains SOURCE retention annotations. It should added as `requires static`"); - } - return s; - }) + try (var bufferedReader = APContext.getModuleInfoReader()) { + var reader = new ModuleInfoReader(module, bufferedReader); + reader.requires().forEach(r -> { + if (!r.isStatic() && r.getDependency().getQualifiedName().contentEquals("io.avaje.http.api.javalin")) { + logWarn(module, "io.avaje.http.api.javalin only contains SOURCE retention annotations. It should added as `requires static`"); + } + }); + var fqn = CTX.get().clientFQN; + if (CTX.get().spiPresent || fqn == null) { + return; + } + var noProvides = reader.provides().stream() + .filter(p -> "io.avaje.http.client.HttpClient.GeneratedComponent".equals(p.service())) + .map(Provides::implementations) + .flatMap(List::stream) .noneMatch(s -> s.contains(fqn)); + if (noProvides && !buildPluginAvailable()) { logError(module, "Missing `provides io.avaje.http.client.HttpClient.GeneratedComponent with %s;`", fqn); } @@ -309,4 +299,8 @@ private static boolean resourceExists(String relativeName) { return false; } } + + public static void addClientComponent(String clientFQN) { + CTX.get().clientFQN = clientFQN; + } } diff --git a/pom.xml b/pom.xml index 38b391f5..e82b7fe2 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ true 2.2.22 2.14.2 - 1.24 + 1.25 ${project.build.directory}${file.separator}module-info.shade From 44285f3eda1f2c95d1016e04beb7358f182a22f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 19:39:57 +0000 Subject: [PATCH 12/54] Bump io.avaje:avaje-prisms from 1.25 to 1.26 Bumps [io.avaje:avaje-prisms](https://github.com/avaje/avaje-prisms) from 1.25 to 1.26. - [Release notes](https://github.com/avaje/avaje-prisms/releases) - [Commits](https://github.com/avaje/avaje-prisms/compare/1.25...1.26) --- updated-dependencies: - dependency-name: io.avaje:avaje-prisms dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e82b7fe2..6f2aabc4 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ true 2.2.22 2.14.2 - 1.25 + 1.26 ${project.build.directory}${file.separator}module-info.shade From be5ae7b7d60321fefcc64924c4ddc8fc580e64fb Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Tue, 25 Jun 2024 19:01:28 -0400 Subject: [PATCH 13/54] use prisms to validate modules (#458) --- .../generator/core/ProcessingContext.java | 28 ++++--------------- pom.xml | 2 +- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/ProcessingContext.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/ProcessingContext.java index 6cab59ba..f15a9ebc 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/ProcessingContext.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/ProcessingContext.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.Objects; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -26,7 +27,6 @@ import javax.tools.JavaFileObject; import javax.tools.StandardLocation; -import io.avaje.http.generator.core.ModuleInfoReader.Provides; import io.avaje.http.generator.core.openapi.DocContext; public final class ProcessingContext { @@ -49,8 +49,6 @@ private static final class Ctx { private final boolean instrumentAllMethods; private final boolean disableDirectWrites; private final boolean javalin6; - private final boolean spiPresent = APContext.typeElement("io.avaje.spi.internal.ServiceProcessor") != null; - private boolean validated; private String clientFQN; Ctx(ProcessingEnvironment env, PlatformAdapter adapter, boolean generateOpenAPI) { @@ -143,12 +141,8 @@ public static JavaFileObject createWriter(String cls, Element origin) throws IOE /** Create a file writer for the META-INF services file. */ public static FileObject createMetaInfWriter(String target) throws IOException { - var serviceFile = - CTX.get().spiPresent - ? target.replace("META-INF/services/", "META-INF/generated-services/") - : target; - return filer().createResource(StandardLocation.CLASS_OUTPUT, "", serviceFile); + return filer().createResource(StandardLocation.CLASS_OUTPUT, "", target); } public static JavaFileObject createWriter(String cls) throws IOException { @@ -241,8 +235,7 @@ static Stream superTypes(Element element) { public static void validateModule() { var module = APContext.getProjectModuleElement(); - if (module != null && !CTX.get().validated && !module.isUnnamed()) { - CTX.get().validated = true; + if (module != null && !module.isUnnamed()) { try (var bufferedReader = APContext.getModuleInfoReader()) { var reader = new ModuleInfoReader(module, bufferedReader); reader.requires().forEach(r -> { @@ -251,18 +244,9 @@ public static void validateModule() { } }); var fqn = CTX.get().clientFQN; - if (CTX.get().spiPresent || fqn == null) { - return; - } - var noProvides = reader.provides().stream() - .filter(p -> "io.avaje.http.client.HttpClient.GeneratedComponent".equals(p.service())) - .map(Provides::implementations) - .flatMap(List::stream) - .noneMatch(s -> s.contains(fqn)); - - if (noProvides && !buildPluginAvailable()) { - logError(module, "Missing `provides io.avaje.http.client.HttpClient.GeneratedComponent with %s;`", fqn); - } + + reader.validateServices("io.avaje.http.client.HttpClient.GeneratedComponent", Set.of(fqn)); + } catch (Exception e) { // can't read module } diff --git a/pom.xml b/pom.xml index 6f2aabc4..36d1e56a 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ true 2.2.22 2.14.2 - 1.26 + 1.27 ${project.build.directory}${file.separator}module-info.shade From 2d6d5cd064960affc8b55ef9fa288a93c543a0f3 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Wed, 26 Jun 2024 17:40:50 +1200 Subject: [PATCH 14/54] Version 2.6 --- http-api-javalin/pom.xml | 2 +- http-api/pom.xml | 2 +- http-client-gson-adapter/pom.xml | 4 ++-- http-client-moshi-adapter/pom.xml | 4 ++-- http-client/pom.xml | 4 ++-- http-generator-client/pom.xml | 2 +- http-generator-core/pom.xml | 2 +- http-generator-helidon/pom.xml | 2 +- http-generator-javalin/pom.xml | 2 +- http-generator-jex/pom.xml | 2 +- http-inject-plugin/pom.xml | 2 +- pom.xml | 2 +- tests/pom.xml | 2 +- tests/test-client-generation/pom.xml | 2 +- tests/test-client/pom.xml | 2 +- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-javalin/pom.xml | 2 +- tests/test-jex/pom.xml | 2 +- tests/test-nima-jsonb/pom.xml | 2 +- tests/test-nima/pom.xml | 2 +- 20 files changed, 23 insertions(+), 23 deletions(-) diff --git a/http-api-javalin/pom.xml b/http-api-javalin/pom.xml index afc54dfe..40cb4095 100644 --- a/http-api-javalin/pom.xml +++ b/http-api-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC2 + 2.6 .. diff --git a/http-api/pom.xml b/http-api/pom.xml index 83427c7e..1b12be11 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC2 + 2.6 .. diff --git a/http-client-gson-adapter/pom.xml b/http-client-gson-adapter/pom.xml index 2f35cbb0..c13e087d 100644 --- a/http-client-gson-adapter/pom.xml +++ b/http-client-gson-adapter/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC2 + 2.6 avaje-http-client-gson @@ -20,7 +20,7 @@ io.avaje avaje-http-client - 2.6-RC2 + 2.6 provided diff --git a/http-client-moshi-adapter/pom.xml b/http-client-moshi-adapter/pom.xml index 99ecf68a..20a15145 100644 --- a/http-client-moshi-adapter/pom.xml +++ b/http-client-moshi-adapter/pom.xml @@ -3,7 +3,7 @@ io.avaje avaje-http-parent - 2.6-RC2 + 2.6 avaje-http-client-moshi @@ -19,7 +19,7 @@ io.avaje avaje-http-client - 2.6-RC2 + 2.6 provided diff --git a/http-client/pom.xml b/http-client/pom.xml index d6e8df72..822d5807 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC2 + 2.6 avaje-http-client @@ -66,7 +66,7 @@ io.avaje avaje-http-api - 2.6-RC2 + 2.6 test diff --git a/http-generator-client/pom.xml b/http-generator-client/pom.xml index 316cc747..b15c4e49 100644 --- a/http-generator-client/pom.xml +++ b/http-generator-client/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC2 + 2.6 avaje-http-client-generator diff --git a/http-generator-core/pom.xml b/http-generator-core/pom.xml index 7acd999a..290d2148 100644 --- a/http-generator-core/pom.xml +++ b/http-generator-core/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC2 + 2.6 avaje-http-generator-core diff --git a/http-generator-helidon/pom.xml b/http-generator-helidon/pom.xml index bf1e98bf..10b2ec24 100644 --- a/http-generator-helidon/pom.xml +++ b/http-generator-helidon/pom.xml @@ -4,7 +4,7 @@ avaje-http-parent io.avaje - 2.6-RC2 + 2.6 avaje-http-helidon-generator diff --git a/http-generator-javalin/pom.xml b/http-generator-javalin/pom.xml index 1fbd7a61..01c87dd9 100644 --- a/http-generator-javalin/pom.xml +++ b/http-generator-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC2 + 2.6 avaje-http-javalin-generator diff --git a/http-generator-jex/pom.xml b/http-generator-jex/pom.xml index 27295f6c..6e81bfc9 100644 --- a/http-generator-jex/pom.xml +++ b/http-generator-jex/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC2 + 2.6 avaje-http-jex-generator diff --git a/http-inject-plugin/pom.xml b/http-inject-plugin/pom.xml index 208214ea..dce01eb0 100644 --- a/http-inject-plugin/pom.xml +++ b/http-inject-plugin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6-RC2 + 2.6 .. diff --git a/pom.xml b/pom.xml index 36d1e56a..e13bb33e 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ io.avaje avaje-http-parent - 2.6-RC2 + 2.6 pom diff --git a/tests/pom.xml b/tests/pom.xml index 7f729efd..05a44921 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -4,7 +4,7 @@ avaje-http-parent io.avaje - 2.6-RC2 + 2.6 tests diff --git a/tests/test-client-generation/pom.xml b/tests/test-client-generation/pom.xml index fa354fd4..479ce1f1 100644 --- a/tests/test-client-generation/pom.xml +++ b/tests/test-client-generation/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.6-RC2 + 2.6 test-client-generation diff --git a/tests/test-client/pom.xml b/tests/test-client/pom.xml index 9d42f0bb..20b60b03 100644 --- a/tests/test-client/pom.xml +++ b/tests/test-client/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.6-RC2 + 2.6 test-client diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index 2978328b..ab9d8af6 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -5,7 +5,7 @@ io.avaje tests - 2.6-RC2 + 2.6 test-javalin-jsonb diff --git a/tests/test-javalin/pom.xml b/tests/test-javalin/pom.xml index eb7d58c5..037db37f 100644 --- a/tests/test-javalin/pom.xml +++ b/tests/test-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.6-RC2 + 2.6 test-javalin diff --git a/tests/test-jex/pom.xml b/tests/test-jex/pom.xml index d13b2502..d9b36aff 100644 --- a/tests/test-jex/pom.xml +++ b/tests/test-jex/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.6-RC2 + 2.6 test-jex diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 12d29b7d..45d42f4f 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.6-RC2 + 2.6 test-nima-jsonb diff --git a/tests/test-nima/pom.xml b/tests/test-nima/pom.xml index 2d9680a6..c3876398 100644 --- a/tests/test-nima/pom.xml +++ b/tests/test-nima/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.6-RC2 + 2.6 test-nima From ea9e46880194ca663e3bb446797582ca24f65eb5 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Wed, 26 Jun 2024 17:41:26 +1200 Subject: [PATCH 15/54] Bump to next snapshot --- http-api-javalin/pom.xml | 2 +- http-api/pom.xml | 2 +- http-client-gson-adapter/pom.xml | 4 ++-- http-client-moshi-adapter/pom.xml | 4 ++-- http-client/pom.xml | 4 ++-- http-generator-client/pom.xml | 2 +- http-generator-core/pom.xml | 2 +- http-generator-helidon/pom.xml | 2 +- http-generator-javalin/pom.xml | 2 +- http-generator-jex/pom.xml | 2 +- http-inject-plugin/pom.xml | 2 +- pom.xml | 2 +- tests/pom.xml | 2 +- tests/test-client-generation/pom.xml | 2 +- tests/test-client/pom.xml | 2 +- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-javalin/pom.xml | 2 +- tests/test-jex/pom.xml | 2 +- tests/test-nima-jsonb/pom.xml | 2 +- tests/test-nima/pom.xml | 2 +- 20 files changed, 23 insertions(+), 23 deletions(-) diff --git a/http-api-javalin/pom.xml b/http-api-javalin/pom.xml index 40cb4095..9d52bc92 100644 --- a/http-api-javalin/pom.xml +++ b/http-api-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6 + 2.7-SNAPSHOT .. diff --git a/http-api/pom.xml b/http-api/pom.xml index 1b12be11..60bf18d7 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6 + 2.7-SNAPSHOT .. diff --git a/http-client-gson-adapter/pom.xml b/http-client-gson-adapter/pom.xml index c13e087d..5ac5b4c0 100644 --- a/http-client-gson-adapter/pom.xml +++ b/http-client-gson-adapter/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6 + 2.7-SNAPSHOT avaje-http-client-gson @@ -20,7 +20,7 @@ io.avaje avaje-http-client - 2.6 + 2.7-SNAPSHOT provided diff --git a/http-client-moshi-adapter/pom.xml b/http-client-moshi-adapter/pom.xml index 20a15145..a22e4189 100644 --- a/http-client-moshi-adapter/pom.xml +++ b/http-client-moshi-adapter/pom.xml @@ -3,7 +3,7 @@ io.avaje avaje-http-parent - 2.6 + 2.7-SNAPSHOT avaje-http-client-moshi @@ -19,7 +19,7 @@ io.avaje avaje-http-client - 2.6 + 2.7-SNAPSHOT provided diff --git a/http-client/pom.xml b/http-client/pom.xml index 822d5807..e7eb57aa 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6 + 2.7-SNAPSHOT avaje-http-client @@ -66,7 +66,7 @@ io.avaje avaje-http-api - 2.6 + 2.7-SNAPSHOT test diff --git a/http-generator-client/pom.xml b/http-generator-client/pom.xml index b15c4e49..cc906a76 100644 --- a/http-generator-client/pom.xml +++ b/http-generator-client/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6 + 2.7-SNAPSHOT avaje-http-client-generator diff --git a/http-generator-core/pom.xml b/http-generator-core/pom.xml index 290d2148..a9a13ad6 100644 --- a/http-generator-core/pom.xml +++ b/http-generator-core/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6 + 2.7-SNAPSHOT avaje-http-generator-core diff --git a/http-generator-helidon/pom.xml b/http-generator-helidon/pom.xml index 10b2ec24..b4b49849 100644 --- a/http-generator-helidon/pom.xml +++ b/http-generator-helidon/pom.xml @@ -4,7 +4,7 @@ avaje-http-parent io.avaje - 2.6 + 2.7-SNAPSHOT avaje-http-helidon-generator diff --git a/http-generator-javalin/pom.xml b/http-generator-javalin/pom.xml index 01c87dd9..5bb515f5 100644 --- a/http-generator-javalin/pom.xml +++ b/http-generator-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6 + 2.7-SNAPSHOT avaje-http-javalin-generator diff --git a/http-generator-jex/pom.xml b/http-generator-jex/pom.xml index 6e81bfc9..6271a090 100644 --- a/http-generator-jex/pom.xml +++ b/http-generator-jex/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6 + 2.7-SNAPSHOT avaje-http-jex-generator diff --git a/http-inject-plugin/pom.xml b/http-inject-plugin/pom.xml index dce01eb0..babbd747 100644 --- a/http-inject-plugin/pom.xml +++ b/http-inject-plugin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.6 + 2.7-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index e13bb33e..7e9066f9 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ io.avaje avaje-http-parent - 2.6 + 2.7-SNAPSHOT pom diff --git a/tests/pom.xml b/tests/pom.xml index 05a44921..25b08684 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -4,7 +4,7 @@ avaje-http-parent io.avaje - 2.6 + 2.7-SNAPSHOT tests diff --git a/tests/test-client-generation/pom.xml b/tests/test-client-generation/pom.xml index 479ce1f1..3e5bb87f 100644 --- a/tests/test-client-generation/pom.xml +++ b/tests/test-client-generation/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.6 + 2.7-SNAPSHOT test-client-generation diff --git a/tests/test-client/pom.xml b/tests/test-client/pom.xml index 20b60b03..cc226f86 100644 --- a/tests/test-client/pom.xml +++ b/tests/test-client/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.6 + 2.7-SNAPSHOT test-client diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index ab9d8af6..37fa3206 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -5,7 +5,7 @@ io.avaje tests - 2.6 + 2.7-SNAPSHOT test-javalin-jsonb diff --git a/tests/test-javalin/pom.xml b/tests/test-javalin/pom.xml index 037db37f..cc7c555f 100644 --- a/tests/test-javalin/pom.xml +++ b/tests/test-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.6 + 2.7-SNAPSHOT test-javalin diff --git a/tests/test-jex/pom.xml b/tests/test-jex/pom.xml index d9b36aff..4c187c2d 100644 --- a/tests/test-jex/pom.xml +++ b/tests/test-jex/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.6 + 2.7-SNAPSHOT test-jex diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 45d42f4f..9b90aa2e 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.6 + 2.7-SNAPSHOT test-nima-jsonb diff --git a/tests/test-nima/pom.xml b/tests/test-nima/pom.xml index c3876398..59d2ba44 100644 --- a/tests/test-nima/pom.xml +++ b/tests/test-nima/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.6 + 2.7-SNAPSHOT test-nima From 6345352532a2cc7049abdd4cb567b40fc167a63e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 19:41:26 +0000 Subject: [PATCH 16/54] Bump junit.version from 5.10.2 to 5.10.3 Bumps `junit.version` from 5.10.2 to 5.10.3. Updates `org.junit.jupiter:junit-jupiter-api` from 5.10.2 to 5.10.3 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.2...r5.10.3) Updates `org.junit.jupiter:junit-jupiter-engine` from 5.10.2 to 5.10.3 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.2...r5.10.3) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-api dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pom.xml b/tests/pom.xml index 25b08684..4c2c1179 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -12,7 +12,7 @@ true - 5.10.2 + 5.10.3 3.26.0 2.17.1 2.5 From ec9cb063ed1cc4fdceb0d07b82f02685f7362b61 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 19:43:22 +0000 Subject: [PATCH 17/54] Bump io.avaje:avaje-jsonb from 1.11 to 1.12 Bumps [io.avaje:avaje-jsonb](https://github.com/avaje/avaje-jsonb) from 1.11 to 1.12. - [Release notes](https://github.com/avaje/avaje-jsonb/releases) - [Commits](https://github.com/avaje/avaje-jsonb/compare/1.11...1.12) --- updated-dependencies: - dependency-name: io.avaje:avaje-jsonb dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- http-client/pom.xml | 2 +- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-nima-jsonb/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/http-client/pom.xml b/http-client/pom.xml index e7eb57aa..b3e1df9c 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -36,7 +36,7 @@ io.avaje avaje-jsonb - 1.11 + 1.12 true diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index 37fa3206..bf631265 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -80,7 +80,7 @@ io.avaje avaje-jsonb - 1.11 + 1.12 diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 9b90aa2e..4c574c3e 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -31,7 +31,7 @@ io.avaje avaje-jsonb - 1.11 + 1.12 io.avaje From 85b1d3facc88de6fc19d4289f6b6ff0b60372263 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 19:45:18 +0000 Subject: [PATCH 18/54] Bump io.avaje:avaje-jsonb-generator from 1.11 to 1.12 Bumps io.avaje:avaje-jsonb-generator from 1.11 to 1.12. --- updated-dependencies: - dependency-name: io.avaje:avaje-jsonb-generator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-nima-jsonb/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index bf631265..9d39db6a 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -86,7 +86,7 @@ io.avaje avaje-jsonb-generator - 1.11 + 1.12 provided diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 4c574c3e..3259d44a 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -90,7 +90,7 @@ io.avaje avaje-jsonb-generator - 1.11 + 1.12 From 8698c39a84c682af346e0c6946354e2c53fdf908 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 19:49:31 +0000 Subject: [PATCH 19/54] Bump io.rest-assured:rest-assured from 5.4.0 to 5.5.0 Bumps [io.rest-assured:rest-assured](https://github.com/rest-assured/rest-assured) from 5.4.0 to 5.5.0. - [Changelog](https://github.com/rest-assured/rest-assured/blob/master/changelog.txt) - [Commits](https://github.com/rest-assured/rest-assured/compare/rest-assured-5.4.0...rest-assured-5.5.0) --- updated-dependencies: - dependency-name: io.rest-assured:rest-assured dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-javalin/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index 9d39db6a..087d6bba 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -101,7 +101,7 @@ io.rest-assured rest-assured - 5.4.0 + 5.5.0 test diff --git a/tests/test-javalin/pom.xml b/tests/test-javalin/pom.xml index cc7c555f..8b4e2a6e 100644 --- a/tests/test-javalin/pom.xml +++ b/tests/test-javalin/pom.xml @@ -94,7 +94,7 @@ io.rest-assured rest-assured - 5.4.0 + 5.5.0 test From f19146557e207821263d86808b0ba7aeeba3025a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 19:51:10 +0000 Subject: [PATCH 20/54] Bump com.fasterxml.jackson.core:jackson-databind from 2.17.1 to 2.17.2 Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.17.1 to 2.17.2. - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- http-client/pom.xml | 2 +- tests/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/http-client/pom.xml b/http-client/pom.xml index b3e1df9c..87cca63e 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -29,7 +29,7 @@ com.fasterxml.jackson.core jackson-databind - 2.17.1 + 2.17.2 true diff --git a/tests/pom.xml b/tests/pom.xml index 4c2c1179..43e395e8 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -14,7 +14,7 @@ true 5.10.3 3.26.0 - 2.17.1 + 2.17.2 2.5 9.12 4.0.10 From 88effbd84b776f38f17990daf933b94949bdb9cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 19:53:05 +0000 Subject: [PATCH 21/54] Bump io.avaje:avaje-prisms from 1.27 to 1.28 Bumps [io.avaje:avaje-prisms](https://github.com/avaje/avaje-prisms) from 1.27 to 1.28. - [Release notes](https://github.com/avaje/avaje-prisms/releases) - [Commits](https://github.com/avaje/avaje-prisms/compare/1.27...1.28) --- updated-dependencies: - dependency-name: io.avaje:avaje-prisms dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7e9066f9..24bc5608 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ true 2.2.22 2.14.2 - 1.27 + 1.28 ${project.build.directory}${file.separator}module-info.shade From 0fd3277b04c220c5380708b257913f47ed53f73c Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Wed, 10 Jul 2024 21:17:22 +1200 Subject: [PATCH 22/54] Version 2.7 --- http-api-javalin/pom.xml | 2 +- http-api/pom.xml | 2 +- http-client-gson-adapter/pom.xml | 4 ++-- http-client-moshi-adapter/pom.xml | 4 ++-- http-client/pom.xml | 4 ++-- http-generator-client/pom.xml | 2 +- http-generator-core/pom.xml | 2 +- http-generator-helidon/pom.xml | 2 +- http-generator-javalin/pom.xml | 2 +- http-generator-jex/pom.xml | 2 +- http-inject-plugin/pom.xml | 2 +- pom.xml | 2 +- tests/pom.xml | 2 +- tests/test-client-generation/pom.xml | 2 +- tests/test-client/pom.xml | 2 +- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-javalin/pom.xml | 2 +- tests/test-jex/pom.xml | 2 +- tests/test-nima-jsonb/pom.xml | 2 +- tests/test-nima/pom.xml | 2 +- 20 files changed, 23 insertions(+), 23 deletions(-) diff --git a/http-api-javalin/pom.xml b/http-api-javalin/pom.xml index 9d52bc92..ac78d243 100644 --- a/http-api-javalin/pom.xml +++ b/http-api-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7-SNAPSHOT + 2.7 .. diff --git a/http-api/pom.xml b/http-api/pom.xml index 60bf18d7..14980b37 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7-SNAPSHOT + 2.7 .. diff --git a/http-client-gson-adapter/pom.xml b/http-client-gson-adapter/pom.xml index 5ac5b4c0..87d5d4fd 100644 --- a/http-client-gson-adapter/pom.xml +++ b/http-client-gson-adapter/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7-SNAPSHOT + 2.7 avaje-http-client-gson @@ -20,7 +20,7 @@ io.avaje avaje-http-client - 2.7-SNAPSHOT + 2.7 provided diff --git a/http-client-moshi-adapter/pom.xml b/http-client-moshi-adapter/pom.xml index a22e4189..e0e01a11 100644 --- a/http-client-moshi-adapter/pom.xml +++ b/http-client-moshi-adapter/pom.xml @@ -3,7 +3,7 @@ io.avaje avaje-http-parent - 2.7-SNAPSHOT + 2.7 avaje-http-client-moshi @@ -19,7 +19,7 @@ io.avaje avaje-http-client - 2.7-SNAPSHOT + 2.7 provided diff --git a/http-client/pom.xml b/http-client/pom.xml index 87cca63e..1cb4dd67 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7-SNAPSHOT + 2.7 avaje-http-client @@ -66,7 +66,7 @@ io.avaje avaje-http-api - 2.7-SNAPSHOT + 2.7 test diff --git a/http-generator-client/pom.xml b/http-generator-client/pom.xml index cc906a76..85186fad 100644 --- a/http-generator-client/pom.xml +++ b/http-generator-client/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7-SNAPSHOT + 2.7 avaje-http-client-generator diff --git a/http-generator-core/pom.xml b/http-generator-core/pom.xml index a9a13ad6..817ca421 100644 --- a/http-generator-core/pom.xml +++ b/http-generator-core/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7-SNAPSHOT + 2.7 avaje-http-generator-core diff --git a/http-generator-helidon/pom.xml b/http-generator-helidon/pom.xml index b4b49849..3d5349a2 100644 --- a/http-generator-helidon/pom.xml +++ b/http-generator-helidon/pom.xml @@ -4,7 +4,7 @@ avaje-http-parent io.avaje - 2.7-SNAPSHOT + 2.7 avaje-http-helidon-generator diff --git a/http-generator-javalin/pom.xml b/http-generator-javalin/pom.xml index 5bb515f5..39649461 100644 --- a/http-generator-javalin/pom.xml +++ b/http-generator-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7-SNAPSHOT + 2.7 avaje-http-javalin-generator diff --git a/http-generator-jex/pom.xml b/http-generator-jex/pom.xml index 6271a090..ebd49a79 100644 --- a/http-generator-jex/pom.xml +++ b/http-generator-jex/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7-SNAPSHOT + 2.7 avaje-http-jex-generator diff --git a/http-inject-plugin/pom.xml b/http-inject-plugin/pom.xml index babbd747..1563ddc4 100644 --- a/http-inject-plugin/pom.xml +++ b/http-inject-plugin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7-SNAPSHOT + 2.7 .. diff --git a/pom.xml b/pom.xml index 24bc5608..ed308983 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ io.avaje avaje-http-parent - 2.7-SNAPSHOT + 2.7 pom diff --git a/tests/pom.xml b/tests/pom.xml index 43e395e8..fe5e6be0 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -4,7 +4,7 @@ avaje-http-parent io.avaje - 2.7-SNAPSHOT + 2.7 tests diff --git a/tests/test-client-generation/pom.xml b/tests/test-client-generation/pom.xml index 3e5bb87f..ee5c1e62 100644 --- a/tests/test-client-generation/pom.xml +++ b/tests/test-client-generation/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.7-SNAPSHOT + 2.7 test-client-generation diff --git a/tests/test-client/pom.xml b/tests/test-client/pom.xml index cc226f86..f0750b0f 100644 --- a/tests/test-client/pom.xml +++ b/tests/test-client/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.7-SNAPSHOT + 2.7 test-client diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index 087d6bba..54aa5f46 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -5,7 +5,7 @@ io.avaje tests - 2.7-SNAPSHOT + 2.7 test-javalin-jsonb diff --git a/tests/test-javalin/pom.xml b/tests/test-javalin/pom.xml index 8b4e2a6e..d2e89b31 100644 --- a/tests/test-javalin/pom.xml +++ b/tests/test-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.7-SNAPSHOT + 2.7 test-javalin diff --git a/tests/test-jex/pom.xml b/tests/test-jex/pom.xml index 4c187c2d..e93722d1 100644 --- a/tests/test-jex/pom.xml +++ b/tests/test-jex/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.7-SNAPSHOT + 2.7 test-jex diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 3259d44a..645ef853 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.7-SNAPSHOT + 2.7 test-nima-jsonb diff --git a/tests/test-nima/pom.xml b/tests/test-nima/pom.xml index 59d2ba44..a27501e1 100644 --- a/tests/test-nima/pom.xml +++ b/tests/test-nima/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.7-SNAPSHOT + 2.7 test-nima From f368e2ad990a1d512830fa5afd06fd64889adff0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:32:44 +0000 Subject: [PATCH 23/54] Bump avaje-inject.version from 9.12 to 10.0 Bumps `avaje-inject.version` from 9.12 to 10.0. Updates `io.avaje:avaje-inject` from 9.12 to 10.0 - [Release notes](https://github.com/avaje/avaje-inject/releases) - [Commits](https://github.com/avaje/avaje-inject/compare/9.12...10.0) Updates `io.avaje:avaje-inject-generator` from 9.12 to 10.0 --- updated-dependencies: - dependency-name: io.avaje:avaje-inject dependency-type: direct:production update-type: version-update:semver-major - dependency-name: io.avaje:avaje-inject-generator dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- http-client/pom.xml | 4 ++-- http-inject-plugin/pom.xml | 2 +- tests/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/http-client/pom.xml b/http-client/pom.xml index 1cb4dd67..a824705c 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -43,7 +43,7 @@ io.avaje avaje-inject - 9.12 + 10.0 true @@ -99,7 +99,7 @@ io.avaje avaje-inject-generator - 9.12 + 10.0 diff --git a/http-inject-plugin/pom.xml b/http-inject-plugin/pom.xml index 1563ddc4..c62ab590 100644 --- a/http-inject-plugin/pom.xml +++ b/http-inject-plugin/pom.xml @@ -19,7 +19,7 @@ io.avaje avaje-inject - 9.12 + 10.0 provided true diff --git a/tests/pom.xml b/tests/pom.xml index fe5e6be0..ec4abdcc 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -16,7 +16,7 @@ 3.26.0 2.17.2 2.5 - 9.12 + 10.0 4.0.10 6.1.6 From 009d2f860a2ad9cd362b2dfb5a128d0283d63ad2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:35:00 +0000 Subject: [PATCH 24/54] Bump org.assertj:assertj-core from 3.26.0 to 3.26.3 Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.26.0 to 3.26.3. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.26.0...assertj-build-3.26.3) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pom.xml b/tests/pom.xml index ec4abdcc..8f4fc5cd 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -13,7 +13,7 @@ true 5.10.3 - 3.26.0 + 3.26.3 2.17.2 2.5 10.0 From 604dd3cd5258d58c793dec8598d15753ccde2bee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:37:17 +0000 Subject: [PATCH 25/54] Bump io.avaje:avaje-inject-maven-plugin from 1.2 to 10.0 Bumps io.avaje:avaje-inject-maven-plugin from 1.2 to 10.0. --- updated-dependencies: - dependency-name: io.avaje:avaje-inject-maven-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- tests/test-nima-jsonb/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 645ef853..ad9568af 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -109,7 +109,7 @@ io.avaje avaje-inject-maven-plugin - 1.2 + 10.0 process-sources From e6dfe89f87e04919d744bd976f48e8eba36d3f0b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:39:41 +0000 Subject: [PATCH 26/54] Bump io.avaje:avaje-jsonb from 1.12 to 2.0 Bumps [io.avaje:avaje-jsonb](https://github.com/avaje/avaje-jsonb) from 1.12 to 2.0. - [Release notes](https://github.com/avaje/avaje-jsonb/releases) - [Commits](https://github.com/avaje/avaje-jsonb/compare/1.12...2.0) --- updated-dependencies: - dependency-name: io.avaje:avaje-jsonb dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- http-client/pom.xml | 2 +- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-nima-jsonb/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/http-client/pom.xml b/http-client/pom.xml index a824705c..1a59e62d 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -36,7 +36,7 @@ io.avaje avaje-jsonb - 1.12 + 2.0 true diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index 54aa5f46..03cbcadb 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -80,7 +80,7 @@ io.avaje avaje-jsonb - 1.12 + 2.0 diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index ad9568af..40e11679 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -31,7 +31,7 @@ io.avaje avaje-jsonb - 1.12 + 2.0 io.avaje From ff7c8f1e90bdc61e55a4a0747dc388e73a5a84e6 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:31:57 -0400 Subject: [PATCH 27/54] bump generator --- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-nima-jsonb/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index 03cbcadb..bfd2059d 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -86,7 +86,7 @@ io.avaje avaje-jsonb-generator - 1.12 + 2.0 provided diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 40e11679..b9a77740 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -90,7 +90,7 @@ io.avaje avaje-jsonb-generator - 1.12 + 2.0 From 31960571ec3e0101507f7e3bfb818a0b893442a1 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:35:03 -0400 Subject: [PATCH 28/54] Update JavalinProcessorTest.java --- .../avaje/http/generator/JavalinProcessorTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test-javalin-jsonb/src/test/java/io/avaje/http/generator/JavalinProcessorTest.java b/tests/test-javalin-jsonb/src/test/java/io/avaje/http/generator/JavalinProcessorTest.java index cc544108..b2262c87 100644 --- a/tests/test-javalin-jsonb/src/test/java/io/avaje/http/generator/JavalinProcessorTest.java +++ b/tests/test-javalin-jsonb/src/test/java/io/avaje/http/generator/JavalinProcessorTest.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.avaje.http.generator.javalin.JavalinProcessor; -import io.avaje.jsonb.generator.Processor; +import io.avaje.jsonb.generator.JsonbProcessor; class JavalinProcessorTest { @@ -76,7 +76,7 @@ public void runAnnotationProcessorJsonB() throws Exception { final var task = compiler.getTask( new PrintWriter(System.out), null, null, List.of("--release=11"), null, files); - task.setProcessors(List.of(new JavalinProcessor(), new Processor())); + task.setProcessors(List.of(new JavalinProcessor(), new JsonbProcessor())); assertThat(task.call()).isTrue(); assert Files.readString( @@ -104,7 +104,7 @@ public void runAnnotationProcessorJavax() throws Exception { "-AdisableDirectWrites=true"), null, files); - task.setProcessors(List.of(new JavalinProcessor(), new Processor())); + task.setProcessors(List.of(new JavalinProcessor(), new JsonbProcessor())); // we don't have javax on the cp assertThat(task.call()).isFalse(); @@ -133,7 +133,7 @@ public void runAnnotationProcessorJakarta() throws Exception { "-AdisableDirectWrites=true"), null, files); - task.setProcessors(List.of(new JavalinProcessor(), new Processor())); + task.setProcessors(List.of(new JavalinProcessor(), new JsonbProcessor())); assertThat(task.call()).isTrue(); @@ -163,7 +163,7 @@ public void testOpenAPIGeneration() throws Exception { List.of("--release=11", "-AdisableDirectWrites=true"), null, openAPIController); - task.setProcessors(List.of(new JavalinProcessor(), new Processor())); + task.setProcessors(List.of(new JavalinProcessor(), new JsonbProcessor())); assertThat(task.call()).isTrue(); @@ -197,7 +197,7 @@ public void testInheritableOpenAPIGeneration() throws Exception { List.of("--release=11", "-AdisableDirectWrites=true"), null, openAPIController); - task.setProcessors(List.of(new JavalinProcessor(), new Processor())); + task.setProcessors(List.of(new JavalinProcessor(), new JsonbProcessor())); assertThat(task.call()).isTrue(); From 6a84f9b5b11d5efe9e3de058e2626a650ff726d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:13:57 +0000 Subject: [PATCH 29/54] Bump avaje-inject.version from 10.0 to 10.1 Bumps `avaje-inject.version` from 10.0 to 10.1. Updates `io.avaje:avaje-inject` from 10.0 to 10.1 - [Release notes](https://github.com/avaje/avaje-inject/releases) - [Commits](https://github.com/avaje/avaje-inject/compare/10.0...10.1) Updates `io.avaje:avaje-inject-generator` from 10.0 to 10.1 --- updated-dependencies: - dependency-name: io.avaje:avaje-inject dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.avaje:avaje-inject-generator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- http-client/pom.xml | 4 ++-- http-inject-plugin/pom.xml | 2 +- tests/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/http-client/pom.xml b/http-client/pom.xml index 1a59e62d..799ba439 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -43,7 +43,7 @@ io.avaje avaje-inject - 10.0 + 10.1 true @@ -99,7 +99,7 @@ io.avaje avaje-inject-generator - 10.0 + 10.1 diff --git a/http-inject-plugin/pom.xml b/http-inject-plugin/pom.xml index c62ab590..8d844bc4 100644 --- a/http-inject-plugin/pom.xml +++ b/http-inject-plugin/pom.xml @@ -19,7 +19,7 @@ io.avaje avaje-inject - 10.0 + 10.1 provided true diff --git a/tests/pom.xml b/tests/pom.xml index 8f4fc5cd..e6ce1d2d 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -16,7 +16,7 @@ 3.26.3 2.17.2 2.5 - 10.0 + 10.1 4.0.10 6.1.6 From 2548b73104e40e75e1307b11641727e977040feb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:16:10 +0000 Subject: [PATCH 30/54] Bump io.avaje:avaje-prisms from 1.28 to 1.29 Bumps [io.avaje:avaje-prisms](https://github.com/avaje/avaje-prisms) from 1.28 to 1.29. - [Release notes](https://github.com/avaje/avaje-prisms/releases) - [Commits](https://github.com/avaje/avaje-prisms/compare/1.28...1.29) --- updated-dependencies: - dependency-name: io.avaje:avaje-prisms dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ed308983..e4f95c7a 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ true 2.2.22 2.14.2 - 1.28 + 1.29 ${project.build.directory}${file.separator}module-info.shade From 5a4f3cf35a0c47b5b3b2cb71da462b6b0d338b3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:18:07 +0000 Subject: [PATCH 31/54] Bump nima.version from 4.0.10 to 4.0.11 Bumps `nima.version` from 4.0.10 to 4.0.11. Updates `io.helidon.webserver:helidon-webserver` from 4.0.10 to 4.0.11 Updates `io.helidon.http.media:helidon-http-media-jsonb` from 4.0.10 to 4.0.11 --- updated-dependencies: - dependency-name: io.helidon.webserver:helidon-webserver dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.helidon.http.media:helidon-http-media-jsonb dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pom.xml b/tests/pom.xml index e6ce1d2d..f1880d50 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -17,7 +17,7 @@ 2.17.2 2.5 10.1 - 4.0.10 + 4.0.11 6.1.6 From 327f622f1572d8910a99e332a960202538de6e50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:20:03 +0000 Subject: [PATCH 32/54] Bump io.javalin:javalin from 6.1.6 to 6.2.0 Bumps [io.javalin:javalin](https://github.com/javalin/javalin) from 6.1.6 to 6.2.0. - [Release notes](https://github.com/javalin/javalin/releases) - [Commits](https://github.com/javalin/javalin/compare/javalin-parent-6.1.6...javalin-parent-6.2.0) --- updated-dependencies: - dependency-name: io.javalin:javalin dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- http-api/pom.xml | 2 +- http-client/pom.xml | 2 +- tests/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/http-api/pom.xml b/http-api/pom.xml index 14980b37..4c5548bd 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -24,7 +24,7 @@ io.javalin javalin - 6.1.6 + 6.2.0 provided true diff --git a/http-client/pom.xml b/http-client/pom.xml index 799ba439..78fefba5 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -59,7 +59,7 @@ io.javalin javalin - 6.1.6 + 6.2.0 test diff --git a/tests/pom.xml b/tests/pom.xml index f1880d50..a9fcf3b1 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -18,7 +18,7 @@ 2.5 10.1 4.0.11 - 6.1.6 + 6.2.0 From a9e714892d0f6cfdde3dff956a7fa81b1bd47b68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:22:35 +0000 Subject: [PATCH 33/54] Bump io.avaje:avaje-inject-maven-plugin from 10.0 to 10.1 Bumps io.avaje:avaje-inject-maven-plugin from 10.0 to 10.1. --- updated-dependencies: - dependency-name: io.avaje:avaje-inject-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/test-nima-jsonb/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index b9a77740..02756bd8 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -109,7 +109,7 @@ io.avaje avaje-inject-maven-plugin - 10.0 + 10.1 process-sources From 2a3a664741cc47086af4d5cbcb0993211d27447b Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Tue, 23 Jul 2024 00:24:48 -0400 Subject: [PATCH 34/54] update hibernate validator (#476) --- http-hibernate-validator/pom.xml | 8 ++++---- .../avaje/http/hibernate/validator/ValidatorProvider.java | 2 +- http-hibernate-validator/src/main/java/module-info.java | 2 +- ...ect.spi.Plugin => io.avaje.inject.spi.InjectExtension} | 0 4 files changed, 6 insertions(+), 6 deletions(-) rename http-hibernate-validator/src/main/resources/META-INF/services/{io.avaje.inject.spi.Plugin => io.avaje.inject.spi.InjectExtension} (100%) diff --git a/http-hibernate-validator/pom.xml b/http-hibernate-validator/pom.xml index 2990065c..323d5394 100644 --- a/http-hibernate-validator/pom.xml +++ b/http-hibernate-validator/pom.xml @@ -5,12 +5,12 @@ io.avaje avaje-http-hibernate-validator - 3.5-RC3 + 3.5 org.avaje java11-oss - 3.10 + 4.3 @@ -36,14 +36,14 @@ io.avaje avaje-http-api - 2.0-RC1 + 2.6 provided io.avaje avaje-inject - 9.3 + 10.1 provided diff --git a/http-hibernate-validator/src/main/java/io/avaje/http/hibernate/validator/ValidatorProvider.java b/http-hibernate-validator/src/main/java/io/avaje/http/hibernate/validator/ValidatorProvider.java index ce2d3356..cb875922 100644 --- a/http-hibernate-validator/src/main/java/io/avaje/http/hibernate/validator/ValidatorProvider.java +++ b/http-hibernate-validator/src/main/java/io/avaje/http/hibernate/validator/ValidatorProvider.java @@ -6,7 +6,7 @@ /** * Plugin for avaje inject that provides a default BeanValidator instance. */ -public final class ValidatorProvider implements io.avaje.inject.spi.Plugin { +public final class ValidatorProvider implements io.avaje.inject.spi.InjectPlugin { @Override public Class[] provides() { diff --git a/http-hibernate-validator/src/main/java/module-info.java b/http-hibernate-validator/src/main/java/module-info.java index dbd4a1f5..2d1c0f6f 100644 --- a/http-hibernate-validator/src/main/java/module-info.java +++ b/http-hibernate-validator/src/main/java/module-info.java @@ -8,5 +8,5 @@ requires io.avaje.inject; requires jakarta.validation; - provides io.avaje.inject.spi.Plugin with ValidatorProvider; + provides io.avaje.inject.spi.InjectExtension with ValidatorProvider; } diff --git a/http-hibernate-validator/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin b/http-hibernate-validator/src/main/resources/META-INF/services/io.avaje.inject.spi.InjectExtension similarity index 100% rename from http-hibernate-validator/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin rename to http-hibernate-validator/src/main/resources/META-INF/services/io.avaje.inject.spi.InjectExtension From 9a44222f014c8b69cd760cdc5b29451a9fbed02e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 19:46:23 +0000 Subject: [PATCH 35/54] Bump io.avaje:avaje-prisms from 1.29 to 1.31 Bumps [io.avaje:avaje-prisms](https://github.com/avaje/avaje-prisms) from 1.29 to 1.31. - [Release notes](https://github.com/avaje/avaje-prisms/releases) - [Commits](https://github.com/avaje/avaje-prisms/compare/1.29...1.31) --- updated-dependencies: - dependency-name: io.avaje:avaje-prisms dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e4f95c7a..34d114bc 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ true 2.2.22 2.14.2 - 1.29 + 1.31 ${project.build.directory}${file.separator}module-info.shade From 689efa666c91412b69579340c6044104db3c0aa4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 11:22:23 +0000 Subject: [PATCH 36/54] Bump avaje-inject.version from 10.1 to 10.3 Bumps `avaje-inject.version` from 10.1 to 10.3. Updates `io.avaje:avaje-inject` from 10.1 to 10.3 - [Release notes](https://github.com/avaje/avaje-inject/releases) - [Commits](https://github.com/avaje/avaje-inject/compare/10.1...10.3) Updates `io.avaje:avaje-inject-generator` from 10.1 to 10.3 --- updated-dependencies: - dependency-name: io.avaje:avaje-inject dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.avaje:avaje-inject-generator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- http-client/pom.xml | 4 ++-- http-inject-plugin/pom.xml | 2 +- tests/pom.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/http-client/pom.xml b/http-client/pom.xml index 78fefba5..e88445b0 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -43,7 +43,7 @@ io.avaje avaje-inject - 10.1 + 10.3 true @@ -99,7 +99,7 @@ io.avaje avaje-inject-generator - 10.1 + 10.3 diff --git a/http-inject-plugin/pom.xml b/http-inject-plugin/pom.xml index 8d844bc4..732c22b5 100644 --- a/http-inject-plugin/pom.xml +++ b/http-inject-plugin/pom.xml @@ -19,7 +19,7 @@ io.avaje avaje-inject - 10.1 + 10.3 provided true diff --git a/tests/pom.xml b/tests/pom.xml index a9fcf3b1..c4173ff3 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -16,7 +16,7 @@ 3.26.3 2.17.2 2.5 - 10.1 + 10.3 4.0.11 6.2.0 From de6e2151985e343b3aa852c6db5ab87d494afe0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 11:24:29 +0000 Subject: [PATCH 37/54] Bump io.avaje:avaje-inject-maven-plugin from 10.1 to 10.3 Bumps io.avaje:avaje-inject-maven-plugin from 10.1 to 10.3. --- updated-dependencies: - dependency-name: io.avaje:avaje-inject-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/test-nima-jsonb/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 02756bd8..4684f52a 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -109,7 +109,7 @@ io.avaje avaje-inject-maven-plugin - 10.1 + 10.3 process-sources From 7aed283d1035f08722c7cc8054e68c041cd4bcc1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:48:19 +0000 Subject: [PATCH 38/54] Bump io.avaje:avaje-jsonb from 2.0 to 2.1 Bumps [io.avaje:avaje-jsonb](https://github.com/avaje/avaje-jsonb) from 2.0 to 2.1. - [Release notes](https://github.com/avaje/avaje-jsonb/releases) - [Commits](https://github.com/avaje/avaje-jsonb/compare/2.0...2.1) --- updated-dependencies: - dependency-name: io.avaje:avaje-jsonb dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- http-client/pom.xml | 2 +- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-nima-jsonb/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/http-client/pom.xml b/http-client/pom.xml index e88445b0..b0a81dd9 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -36,7 +36,7 @@ io.avaje avaje-jsonb - 2.0 + 2.1 true diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index bfd2059d..353afaf4 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -80,7 +80,7 @@ io.avaje avaje-jsonb - 2.0 + 2.1 diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 4684f52a..571a277e 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -31,7 +31,7 @@ io.avaje avaje-jsonb - 2.0 + 2.1 io.avaje From 650f21c6aae1a1cc2f12c0ab6d455d0789714a5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:50:31 +0000 Subject: [PATCH 39/54] Bump io.avaje:avaje-jsonb-generator from 2.0 to 2.1 Bumps io.avaje:avaje-jsonb-generator from 2.0 to 2.1. --- updated-dependencies: - dependency-name: io.avaje:avaje-jsonb-generator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-nima-jsonb/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index 353afaf4..e628758a 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -86,7 +86,7 @@ io.avaje avaje-jsonb-generator - 2.0 + 2.1 provided diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 571a277e..9c54fb44 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -90,7 +90,7 @@ io.avaje avaje-jsonb-generator - 2.0 + 2.1 From a4de3ba5e412b2a70acb9f964f88b5217a4938da Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Tue, 13 Aug 2024 23:34:49 +1200 Subject: [PATCH 40/54] htmx: Initial add of htmx-api, htmx-nima request support and initial example (#435) * htmx: Initial add of htmx-api, htmx-nima request support and initial example * Bump parent version * Bump parent version * Conditionally build htmx-nima JDK 21+ * Add TemplateRender interface * Add Jscahe TemplateRender for @Htmx * Javadoc, tests pom fix * Bump version * Bump version * Bump htmlx versions to 2.7 --- htmx-api/pom.xml | 25 ++++ .../java/io/avaje/htmx/api/DHxRequest.java | 141 ++++++++++++++++++ .../src/main/java/io/avaje/htmx/api/Html.java | 18 +++ .../java/io/avaje/htmx/api/HtmxRequest.java | 106 +++++++++++++ .../java/io/avaje/htmx/api/HxRequest.java | 54 +++++++ htmx-api/src/main/java/module-info.java | 6 + htmx-nima-jstache/pom.xml | 47 ++++++ .../nima/jstache/DefaultTemplateProvider.java | 21 +++ .../nima/jstache/JStacheTemplateRender.java | 15 ++ .../src/main/java/module-info.java | 11 ++ .../services/io.avaje.inject.spi.Plugin | 1 + htmx-nima/pom.xml | 32 ++++ .../java/io/avaje/htmx/nima/DHxHandler.java | 50 +++++++ .../io/avaje/htmx/nima/DHxHandlerBuilder.java | 38 +++++ .../java/io/avaje/htmx/nima/HxHandler.java | 46 ++++++ .../java/io/avaje/htmx/nima/HxHeaders.java | 65 ++++++++ .../main/java/io/avaje/htmx/nima/HxReq.java | 49 ++++++ .../io/avaje/htmx/nima/TemplateRender.java | 16 ++ htmx-nima/src/main/java/module-info.java | 7 + http-generator-core/pom.xml | 8 + .../http/generator/core/ControllerReader.java | 18 ++- .../http/generator/core/MethodReader.java | 9 ++ .../http/generator/core/package-info.java | 2 + .../src/main/java/module-info.java | 1 + .../helidon/nima/ControllerMethodWriter.java | 48 ++++-- .../helidon/nima/ControllerWriter.java | 23 ++- pom.xml | 12 ++ tests/pom.xml | 1 + tests/test-nima-htmx/pom.xml | 100 +++++++++++++ .../src/main/java/org/example/htmx/Main.java | 15 ++ .../java/org/example/htmx/UIController.java | 29 ++++ .../main/java/org/example/htmx/ViewHome.java | 7 + .../main/java/org/example/htmx/ViewName.java | 13 ++ .../java/org/example/htmx/package-info.java | 4 + .../htmx/template/JstacheTemplateRender.java | 17 +++ .../resources/ui/fragments/layout.mustache | 11 ++ .../src/main/resources/ui/home.mustache | 8 + .../src/main/resources/ui/name.mustache | 6 + .../nest => htmx}/PathNestController.java | 2 +- .../{path/nest => htmx}/package-info.java | 2 +- .../org/example/path/PathTestController.java | 2 +- 41 files changed, 1067 insertions(+), 19 deletions(-) create mode 100644 htmx-api/pom.xml create mode 100644 htmx-api/src/main/java/io/avaje/htmx/api/DHxRequest.java create mode 100644 htmx-api/src/main/java/io/avaje/htmx/api/Html.java create mode 100644 htmx-api/src/main/java/io/avaje/htmx/api/HtmxRequest.java create mode 100644 htmx-api/src/main/java/io/avaje/htmx/api/HxRequest.java create mode 100644 htmx-api/src/main/java/module-info.java create mode 100644 htmx-nima-jstache/pom.xml create mode 100644 htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java create mode 100644 htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/JStacheTemplateRender.java create mode 100644 htmx-nima-jstache/src/main/java/module-info.java create mode 100644 htmx-nima-jstache/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin create mode 100644 htmx-nima/pom.xml create mode 100644 htmx-nima/src/main/java/io/avaje/htmx/nima/DHxHandler.java create mode 100644 htmx-nima/src/main/java/io/avaje/htmx/nima/DHxHandlerBuilder.java create mode 100644 htmx-nima/src/main/java/io/avaje/htmx/nima/HxHandler.java create mode 100644 htmx-nima/src/main/java/io/avaje/htmx/nima/HxHeaders.java create mode 100644 htmx-nima/src/main/java/io/avaje/htmx/nima/HxReq.java create mode 100644 htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateRender.java create mode 100644 htmx-nima/src/main/java/module-info.java create mode 100644 tests/test-nima-htmx/pom.xml create mode 100644 tests/test-nima-htmx/src/main/java/org/example/htmx/Main.java create mode 100644 tests/test-nima-htmx/src/main/java/org/example/htmx/UIController.java create mode 100644 tests/test-nima-htmx/src/main/java/org/example/htmx/ViewHome.java create mode 100644 tests/test-nima-htmx/src/main/java/org/example/htmx/ViewName.java create mode 100644 tests/test-nima-htmx/src/main/java/org/example/htmx/package-info.java create mode 100644 tests/test-nima-htmx/src/main/java/org/example/htmx/template/JstacheTemplateRender.java create mode 100644 tests/test-nima-htmx/src/main/resources/ui/fragments/layout.mustache create mode 100644 tests/test-nima-htmx/src/main/resources/ui/home.mustache create mode 100644 tests/test-nima-htmx/src/main/resources/ui/name.mustache rename tests/test-nima-jsonb/src/main/java/org/example/{path/nest => htmx}/PathNestController.java (92%) rename tests/test-nima-jsonb/src/main/java/org/example/{path/nest => htmx}/package-info.java (61%) diff --git a/htmx-api/pom.xml b/htmx-api/pom.xml new file mode 100644 index 00000000..ad4b7e30 --- /dev/null +++ b/htmx-api/pom.xml @@ -0,0 +1,25 @@ + + + 4.0.0 + + io.avaje + avaje-http-parent + 2.7 + + + avaje-htmx-api + + + + + + + io.avaje + avaje-lang + 1.0 + + + + diff --git a/htmx-api/src/main/java/io/avaje/htmx/api/DHxRequest.java b/htmx-api/src/main/java/io/avaje/htmx/api/DHxRequest.java new file mode 100644 index 00000000..c213b6e1 --- /dev/null +++ b/htmx-api/src/main/java/io/avaje/htmx/api/DHxRequest.java @@ -0,0 +1,141 @@ +package io.avaje.htmx.api; + +import io.avaje.lang.Nullable; + +final class DHxRequest implements HtmxRequest { + + private final boolean htmxRequest; + + private final boolean boosted; + private final String currentUrl; + private final boolean historyRestoreRequest; + private final String promptResponse; + private final String target; + private final String triggerName; + private final String triggerId; + + DHxRequest() { + this.htmxRequest = false; + this.boosted = false; + this.currentUrl = null; + this.historyRestoreRequest = false; + this.promptResponse = null; + this.target = null; + this.triggerName = null; + this.triggerId = null; + } + + DHxRequest(boolean boosted, String currentUrl, boolean historyRestoreRequest, String promptResponse, String target, String triggerName, String triggerId) { + this.htmxRequest = true; + this.boosted = boosted; + this.currentUrl = currentUrl; + this.historyRestoreRequest = historyRestoreRequest; + this.promptResponse = promptResponse; + this.target = target; + this.triggerName = triggerName; + this.triggerId = triggerId; + } + + @Override + public boolean isHtmxRequest() { + return htmxRequest; + } + + @Override + public boolean isBoosted() { + return boosted; + } + + @Nullable + @Override + public String currentUrl() { + return currentUrl; + } + + @Override + public boolean isHistoryRestoreRequest() { + return historyRestoreRequest; + } + + @Nullable + @Override + public String promptResponse() { + return promptResponse; + } + + @Nullable + @Override + public String target() { + return target; + } + + @Nullable + @Override + public String triggerName() { + return triggerName; + } + + @Nullable + public String triggerId() { + return triggerId; + } + + static final class DBuilder implements Builder { + + private boolean boosted; + private String currentUrl; + private boolean historyRestoreRequest; + private String promptResponse; + private String target; + private String triggerName; + private String triggerId; + + @Override + public DBuilder boosted(boolean boosted) { + this.boosted = boosted; + return this; + } + + @Override + public DBuilder currentUrl(String currentUrl) { + this.currentUrl = currentUrl; + return this; + } + + @Override + public DBuilder historyRestoreRequest(boolean historyRestoreRequest) { + this.historyRestoreRequest = historyRestoreRequest; + return this; + } + + @Override + public DBuilder promptResponse(String promptResponse) { + this.promptResponse = promptResponse; + return this; + } + + @Override + public DBuilder target(String target) { + this.target = target; + return this; + } + + @Override + public DBuilder triggerName(String triggerName) { + this.triggerName = triggerName; + return this; + } + + @Override + public DBuilder triggerId(String triggerId) { + this.triggerId = triggerId; + return this; + } + + @Override + public HtmxRequest build() { + return new DHxRequest(boosted, currentUrl, historyRestoreRequest, promptResponse, target, triggerName, triggerId); + } + } + +} diff --git a/htmx-api/src/main/java/io/avaje/htmx/api/Html.java b/htmx-api/src/main/java/io/avaje/htmx/api/Html.java new file mode 100644 index 00000000..bedae0de --- /dev/null +++ b/htmx-api/src/main/java/io/avaje/htmx/api/Html.java @@ -0,0 +1,18 @@ +package io.avaje.htmx.api; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Mark a controller as producing HTML by default and using "Templating" + * meaning that response objects are expected to a "Model View" passed to + * the "Templating" library. + */ +@Target(TYPE) +@Retention(RUNTIME) +public @interface Html { + +} diff --git a/htmx-api/src/main/java/io/avaje/htmx/api/HtmxRequest.java b/htmx-api/src/main/java/io/avaje/htmx/api/HtmxRequest.java new file mode 100644 index 00000000..d8a47a22 --- /dev/null +++ b/htmx-api/src/main/java/io/avaje/htmx/api/HtmxRequest.java @@ -0,0 +1,106 @@ +package io.avaje.htmx.api; + +import io.avaje.lang.Nullable; + +/** + * This class can be used as a controller method argument to access + * the htmx Request Headers. + * + *
{@code
+ *
+ *   @HxRequest
+ *   @Get("/users")
+ *   String users(HtmxRequest htmxRequest) {
+ *     if (htmxRequest.isBoosted()) {
+ *         ...
+ *     }
+ *   }
+ *
+ * }
+ * + * @see Request Headers Reference + */ +public interface HtmxRequest { + + /** + * Represents a non-Htmx request. + */ + HtmxRequest EMPTY = new DHxRequest(); + + /** + * Return a new builder for the HtmxRequest. + */ + static Builder builder() { + return new DHxRequest.DBuilder(); + } + + /** + * Return true if this is an Htmx request. + */ + boolean isHtmxRequest(); + + /** + * Indicates that the request is via an element using hx-boost. + * + * @return true if the request was made via HX-Boost, false otherwise + */ + boolean isBoosted(); + + /** + * Return the current URL of the browser when the htmx request was made. + */ + @Nullable + String currentUrl(); + + /** + * Indicates if the request is for history restoration after a miss in the local history cache + * + * @return true if this request is for history restoration, false otherwise + */ + boolean isHistoryRestoreRequest(); + + /** + * Return the user response to an HX-Prompt. + */ + @Nullable + String promptResponse(); + + /** + * Return the id of the target element if it exists. + */ + @Nullable + String target(); + + /** + * Return the name of the triggered element if it exists. + */ + @Nullable + String triggerName(); + + /** + * Return the id of the triggered element if it exists. + */ + @Nullable + String triggerId(); + + /** + * Builder for {@link HtmxRequest}. + */ + interface Builder { + Builder boosted(boolean boosted); + + Builder currentUrl(String currentUrl); + + Builder historyRestoreRequest(boolean historyRestoreRequest); + + Builder promptResponse(String promptResponse); + + Builder target(String target); + + Builder triggerName(String triggerName); + + Builder triggerId(String triggerId); + + HtmxRequest build(); + } +} diff --git a/htmx-api/src/main/java/io/avaje/htmx/api/HxRequest.java b/htmx-api/src/main/java/io/avaje/htmx/api/HxRequest.java new file mode 100644 index 00000000..e643f31e --- /dev/null +++ b/htmx-api/src/main/java/io/avaje/htmx/api/HxRequest.java @@ -0,0 +1,54 @@ +package io.avaje.htmx.api; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Mark a controller method as handling Htmx requests and potentially restrict + * the handler to only be used for specific Htmx target or Htmx trigger. + *

+ * Controller methods with {@code @HxRequest} require the {@code HX-Request} + * HTTP Header to be set for the handler to process the request. Additionally, + * we can specify {@link #target()}, {@link #triggerId()}, or {@link #triggerName()} + * such that the handler is only invoked specifically for requests with those + * matching headers. + */ +@Target({TYPE, METHOD}) +@Retention(RUNTIME) +public @interface HxRequest { + + /** + * Restricts the mapping to the {@code id} of a specific target element. + * + * @see HX-Target + */ + String target() default ""; + + /** + * Restricts the mapping to the {@code id} of a specific triggered element. + * + * @see HX-Trigger + */ + String triggerId() default ""; + + /** + * Restricts the mapping to the {@code name} of a specific triggered element. + * + * @see HX-Trigger-Name + */ + String triggerName() default ""; + + /** + * Restricts the mapping to the {@code id}, if any, or to the {@code name} of a specific triggered element. + *

+ * If you want to be explicit use {@link #triggerId()} or {@link #triggerName()}. + * + * @see HX-Trigger + * @see HX-Trigger-Name + */ + String value() default ""; +} diff --git a/htmx-api/src/main/java/module-info.java b/htmx-api/src/main/java/module-info.java new file mode 100644 index 00000000..c018025a --- /dev/null +++ b/htmx-api/src/main/java/module-info.java @@ -0,0 +1,6 @@ +module io.avaje.htmx.api { + + exports io.avaje.htmx.api; + + requires static io.avaje.lang; +} diff --git a/htmx-nima-jstache/pom.xml b/htmx-nima-jstache/pom.xml new file mode 100644 index 00000000..3305f71c --- /dev/null +++ b/htmx-nima-jstache/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + io.avaje + avaje-http-parent + 2.7 + + + avaje-htmx-nima-jstache + + + 21 + 21 + 21 + UTF-8 + false + 1.3.5 + + + + + io.jstach + jstachio + ${io.jstach.version} + + + io.avaje + avaje-htmx-api + ${project.version} + + + io.avaje + avaje-htmx-nima + ${project.version} + + + io.avaje + avaje-inject + 10.3 + provided + true + + + diff --git a/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java new file mode 100644 index 00000000..342e2bd4 --- /dev/null +++ b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java @@ -0,0 +1,21 @@ +package io.avaje.htmx.nima.jstache; + +import io.avaje.htmx.nima.TemplateRender; +import io.avaje.inject.BeanScopeBuilder; +import io.avaje.inject.spi.Plugin; + +/** + * Plugin for avaje inject that provides a default TemplateRender instance. + */ +public final class DefaultTemplateProvider implements Plugin { + + @Override + public Class[] provides() { + return new Class[]{TemplateRender.class}; + } + + @Override + public void apply(BeanScopeBuilder builder) { + builder.provideDefault(null, TemplateRender.class, JStacheTemplateRender::new); + } +} diff --git a/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/JStacheTemplateRender.java b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/JStacheTemplateRender.java new file mode 100644 index 00000000..beb4bff6 --- /dev/null +++ b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/JStacheTemplateRender.java @@ -0,0 +1,15 @@ +package io.avaje.htmx.nima.jstache; + +import io.avaje.htmx.nima.TemplateRender; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.jstach.jstachio.JStachio; + +public final class JStacheTemplateRender implements TemplateRender { + + @Override + public void render(Object viewModel, ServerRequest req, ServerResponse res) { + var content = JStachio.render(viewModel); + res.send(content); + } +} diff --git a/htmx-nima-jstache/src/main/java/module-info.java b/htmx-nima-jstache/src/main/java/module-info.java new file mode 100644 index 00000000..2da4668b --- /dev/null +++ b/htmx-nima-jstache/src/main/java/module-info.java @@ -0,0 +1,11 @@ +module io.avaje.htmx.nima.jstache { + + exports io.avaje.htmx.nima.jstache; + + requires transitive io.avaje.htmx.nima; + requires transitive io.helidon.webserver; + requires transitive io.jstach.jstachio; + requires io.avaje.inject; + + provides io.avaje.inject.spi.Plugin with io.avaje.htmx.nima.jstache.DefaultTemplateProvider; +} diff --git a/htmx-nima-jstache/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin b/htmx-nima-jstache/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin new file mode 100644 index 00000000..456aa71f --- /dev/null +++ b/htmx-nima-jstache/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin @@ -0,0 +1 @@ +io.avaje.htmx.nima.jstache.DefaultTemplateProvider diff --git a/htmx-nima/pom.xml b/htmx-nima/pom.xml new file mode 100644 index 00000000..bc405cfe --- /dev/null +++ b/htmx-nima/pom.xml @@ -0,0 +1,32 @@ + + + 4.0.0 + + io.avaje + avaje-http-parent + 2.7 + + + avaje-htmx-nima + + + 21 + false + UTF-8 + + + + + io.avaje + avaje-htmx-api + 2.7 + + + io.helidon.webserver + helidon-webserver + 4.0.7 + + + diff --git a/htmx-nima/src/main/java/io/avaje/htmx/nima/DHxHandler.java b/htmx-nima/src/main/java/io/avaje/htmx/nima/DHxHandler.java new file mode 100644 index 00000000..6b44530a --- /dev/null +++ b/htmx-nima/src/main/java/io/avaje/htmx/nima/DHxHandler.java @@ -0,0 +1,50 @@ +package io.avaje.htmx.nima; + +import io.helidon.http.Header; +import io.helidon.http.ServerRequestHeaders; +import io.helidon.webserver.http.Handler; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +import static io.avaje.htmx.nima.HxHeaders.*; + +final class DHxHandler implements Handler { + + + private final Handler delegate; + private final String target; + private final String trigger; + private final String triggerName; + + DHxHandler(Handler delegate, String target, String trigger, String triggerName) { + this.delegate = delegate; + this.target = target; + this.trigger = trigger; + this.triggerName = triggerName; + } + + @Override + public void handle(ServerRequest req, ServerResponse res) throws Exception { + final var headers = req.headers(); + if (headers.contains(HX_REQUEST) && matched(headers)) { + delegate.handle(req, res); + } else { + res.next(); + } + } + + private boolean matched(ServerRequestHeaders headers) { + if (target != null && notMatched(headers.get(HX_TARGET), target)) { + return false; + } + if (trigger != null && notMatched(headers.get(HX_TRIGGER), trigger)) { + return false; + } + return triggerName == null || !notMatched(headers.get(HX_TRIGGER_NAME), triggerName); + } + + private boolean notMatched(Header header, String matchValue) { + return header == null || !matchValue.equals(header.get()); + } + +} diff --git a/htmx-nima/src/main/java/io/avaje/htmx/nima/DHxHandlerBuilder.java b/htmx-nima/src/main/java/io/avaje/htmx/nima/DHxHandlerBuilder.java new file mode 100644 index 00000000..b9370074 --- /dev/null +++ b/htmx-nima/src/main/java/io/avaje/htmx/nima/DHxHandlerBuilder.java @@ -0,0 +1,38 @@ +package io.avaje.htmx.nima; + +import io.helidon.webserver.http.Handler; + +final class DHxHandlerBuilder implements HxHandler.Builder { + + private final Handler delegate; + private String target; + private String trigger; + private String triggerName; + + DHxHandlerBuilder(Handler delegate) { + this.delegate = delegate; + } + + @Override + public DHxHandlerBuilder target(String target) { + this.target = target; + return this; + } + + @Override + public DHxHandlerBuilder trigger(String trigger) { + this.trigger = trigger; + return this; + } + + @Override + public DHxHandlerBuilder triggerName(String triggerName) { + this.triggerName = triggerName; + return this; + } + + @Override + public Handler build() { + return new DHxHandler(delegate, target, trigger, triggerName); + } +} diff --git a/htmx-nima/src/main/java/io/avaje/htmx/nima/HxHandler.java b/htmx-nima/src/main/java/io/avaje/htmx/nima/HxHandler.java new file mode 100644 index 00000000..0c28dbbd --- /dev/null +++ b/htmx-nima/src/main/java/io/avaje/htmx/nima/HxHandler.java @@ -0,0 +1,46 @@ +package io.avaje.htmx.nima; + +import io.helidon.webserver.http.Handler; + +/** + * Wrap a Handler with filtering for Htmx specific headers. + *

+ * The underlying Handler will not be invoked unless the request + * is a Htmx request and matches the required attributes. + */ +public interface HxHandler { + + /** + * Create a builder that wraps the underlying handler with Htmx + * specific attribute matching. + */ + static Builder builder(Handler delegate) { + return new DHxHandlerBuilder(delegate); + } + + /** + * Build the Htmx request handler. + */ + interface Builder { + + /** + * Match on the given target. + */ + Builder target(String target); + + /** + * Match on the given trigger. + */ + Builder trigger(String trigger); + + /** + * Match on the given trigger name. + */ + Builder triggerName(String triggerName); + + /** + * Build and return the Handler. + */ + Handler build(); + } +} diff --git a/htmx-nima/src/main/java/io/avaje/htmx/nima/HxHeaders.java b/htmx-nima/src/main/java/io/avaje/htmx/nima/HxHeaders.java new file mode 100644 index 00000000..156798d2 --- /dev/null +++ b/htmx-nima/src/main/java/io/avaje/htmx/nima/HxHeaders.java @@ -0,0 +1,65 @@ +package io.avaje.htmx.nima; + +import io.helidon.http.HeaderName; +import io.helidon.http.HeaderNames; + +/** + * HTMX request headers. + * + * @see Request Headers Reference + */ +public interface HxHeaders { + + /** + * Indicates that the request comes from an element that uses hx-boost. + * + * @see HX-Boosted + */ + HeaderName HX_BOOSTED = HeaderNames.create("HX-Boosted"); + + /** + * The current URL of the browser + * + * @see HX-Current-URL + */ + HeaderName HX_CURRENT_URL = HeaderNames.create("HX-Current-URL"); + + /** + * Indicates if the request is for history restoration after a miss in the local history cache. + * + * @see HX-History-Restore-Request + */ + HeaderName HX_HISTORY_RESTORE_REQUEST = HeaderNames.create("HX-History-Restore-Request"); + + /** + * Contains the user response to a hx-prompt. + * + * @see HX-Prompt + */ + HeaderName HX_PROMPT = HeaderNames.create("HX-Prompt"); + /** + * Only present and {@code true} if the request is issued by htmx. + * + * @see HX-Request + */ + HeaderName HX_REQUEST = HeaderNames.create("HX-Request"); + /** + * The {@code id} of the target element if it exists. + * + * @see HX-Target + */ + HeaderName HX_TARGET = HeaderNames.create("HX-Target"); + /** + * The {@code name} of the triggered element if it exists + * + * @see HX-Trigger-Name + */ + HeaderName HX_TRIGGER_NAME = HeaderNames.create("HX-Trigger-Name"); + /** + * The {@code id} of the triggered element if it exists. + * + * @see HX-Trigger + */ + HeaderName HX_TRIGGER = HeaderNames.create("HX-Trigger"); + +} diff --git a/htmx-nima/src/main/java/io/avaje/htmx/nima/HxReq.java b/htmx-nima/src/main/java/io/avaje/htmx/nima/HxReq.java new file mode 100644 index 00000000..2dda4c67 --- /dev/null +++ b/htmx-nima/src/main/java/io/avaje/htmx/nima/HxReq.java @@ -0,0 +1,49 @@ +package io.avaje.htmx.nima; + +import io.avaje.htmx.api.HtmxRequest; +import io.helidon.webserver.http.ServerRequest; + +/** + * Obtain the HtmxRequest for the given Helidon ServerRequest. + */ +public class HxReq { + + /** + * Create given the server request. + */ + public static HtmxRequest of(ServerRequest request) { + final var headers = request.headers(); + if (!headers.contains(HxHeaders.HX_REQUEST)) { + return HtmxRequest.EMPTY; + } + + var builder = HtmxRequest.builder(); + if (headers.contains(HxHeaders.HX_BOOSTED)) { + builder.boosted(true); + } + if (headers.contains(HxHeaders.HX_HISTORY_RESTORE_REQUEST)) { + builder.historyRestoreRequest(true); + } + var currentUrl = headers.get(HxHeaders.HX_CURRENT_URL); + if (currentUrl != null) { + builder.currentUrl(currentUrl.get()); + } + var prompt = headers.get(HxHeaders.HX_PROMPT); + if (prompt != null) { + builder.promptResponse(prompt.get()); + } + var target = headers.get(HxHeaders.HX_TARGET); + if (target != null) { + builder.target(target.get()); + } + var triggerName = headers.get(HxHeaders.HX_TRIGGER_NAME); + if (triggerName != null) { + builder.triggerName(triggerName.get()); + } + var trigger = headers.get(HxHeaders.HX_TRIGGER); + if (trigger != null) { + builder.triggerId(trigger.get()); + } + return builder.build(); + } +} diff --git a/htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateRender.java b/htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateRender.java new file mode 100644 index 00000000..4cc1a62f --- /dev/null +++ b/htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateRender.java @@ -0,0 +1,16 @@ +package io.avaje.htmx.nima; + + +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; + +/** + * Template render API for Helidon. + */ +public interface TemplateRender { + + /** + * Render the given template view model to the server response. + */ + void render(Object viewModel, ServerRequest req, ServerResponse res); +} diff --git a/htmx-nima/src/main/java/module-info.java b/htmx-nima/src/main/java/module-info.java new file mode 100644 index 00000000..8adfb5b4 --- /dev/null +++ b/htmx-nima/src/main/java/module-info.java @@ -0,0 +1,7 @@ +module io.avaje.htmx.nima { + + requires io.avaje.htmx.api; + requires io.helidon.webserver; + + exports io.avaje.htmx.nima; +} diff --git a/http-generator-core/pom.xml b/http-generator-core/pom.xml index 817ca421..2f386802 100644 --- a/http-generator-core/pom.xml +++ b/http-generator-core/pom.xml @@ -26,6 +26,14 @@ provided + + io.avaje + avaje-htmx-api + ${project.version} + true + provided + + io.swagger.core.v3 swagger-annotations diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/ControllerReader.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/ControllerReader.java index 3914821c..12e89fdd 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/ControllerReader.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/ControllerReader.java @@ -47,6 +47,8 @@ public final class ControllerReader { private final String producesPrism; private final boolean hasValid; + /** Set true via {@code @Html} to indicate use of Templating */ + private final boolean html; private boolean methodHasValid; /** @@ -70,7 +72,8 @@ public ControllerReader(TypeElement beanType, String contextPath) { docHidden = initDocHidden(); } this.hasValid = initHasValid(); - this.producesPrism = initProduces(); + this.html = initHtml(); + this.producesPrism = initProduces(html); this.apiResponses = buildApiResponses(); hasInstrument = instrumentAllWebMethods() @@ -172,8 +175,13 @@ private boolean matchMethod(ExecutableElement interfaceMethod, ExecutableElement return interfaceMethod.toString().equals(element.toString()); } - private String initProduces() { - return findAnnotation(ProducesPrism::getOptionalOn).map(ProducesPrism::value).orElse(null); + private boolean initHtml() { + return findAnnotation(HtmlPrism::getOptionalOn).isPresent(); + } + + private String initProduces(boolean html) { + String defaultProduces = html ? "text/html;charset=UTF8" : null; + return findAnnotation(ProducesPrism::getOptionalOn).map(ProducesPrism::value).orElse(defaultProduces); } private boolean initDocHidden() { @@ -188,6 +196,10 @@ String produces() { return producesPrism; } + public boolean html() { + return html; + } + public TypeElement beanType() { return beanType; } diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/MethodReader.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/MethodReader.java index 2ffa86e2..e679f267 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/MethodReader.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/MethodReader.java @@ -43,6 +43,7 @@ public class MethodReader { private final boolean hasValid; private final List superMethods; private final Optional timeout; + private final HxRequestPrism hxRequest; private WebMethod webMethod; private int statusCode; @@ -77,6 +78,7 @@ public class MethodReader { this.securityRequirements = readSecurityRequirements(); this.apiResponses = buildApiResponses(); this.javadoc = buildJavadoc(element); + this.hxRequest = HxRequestPrism.getInstanceOn(element); this.timeout = RequestTimeoutPrism.getOptionalOn(element); timeout.ifPresent( p -> { @@ -190,6 +192,13 @@ private void initSetWebMethod(WebMethod webMethod, ExceptionHandlerPrism excepti bean.addImportType(exType); } + /** + * Return the Htmx request annotation for this method. + */ + public HxRequestPrism hxRequest() { + return hxRequest; + } + public Javadoc javadoc() { return javadoc; } diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/package-info.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/package-info.java index 129ae8cc..efdbc260 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/package-info.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/package-info.java @@ -34,6 +34,8 @@ @GeneratePrism(value = io.swagger.v3.oas.annotations.Hidden.class, publicAccess = true) @GeneratePrism(value = io.avaje.http.api.Client.Import.class, publicAccess = true) @GeneratePrism(value = io.avaje.http.api.RequestTimeout.class, publicAccess = true) +@GeneratePrism(value = io.avaje.htmx.api.HxRequest.class, publicAccess = true) +@GeneratePrism(value = io.avaje.htmx.api.Html.class, publicAccess = true) package io.avaje.http.generator.core; import io.avaje.prism.GeneratePrism; diff --git a/http-generator-core/src/main/java/module-info.java b/http-generator-core/src/main/java/module-info.java index 0d5787e3..f5142424 100644 --- a/http-generator-core/src/main/java/module-info.java +++ b/http-generator-core/src/main/java/module-info.java @@ -10,6 +10,7 @@ // SHADED: All content after this line will be removed at package time requires static io.avaje.prism; requires static io.avaje.http.api; + requires static io.avaje.htmx.api; requires static io.swagger.v3.oas.models; requires static io.swagger.v3.oas.annotations; requires static java.validation; diff --git a/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerMethodWriter.java b/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerMethodWriter.java index 8a31e3a5..ee7bf699 100644 --- a/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerMethodWriter.java +++ b/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerMethodWriter.java @@ -7,14 +7,7 @@ import java.util.Map; import java.util.Optional; -import io.avaje.http.generator.core.Append; -import io.avaje.http.generator.core.CoreWebMethod; -import io.avaje.http.generator.core.MethodParam; -import io.avaje.http.generator.core.MethodReader; -import io.avaje.http.generator.core.ParamType; -import io.avaje.http.generator.core.PathSegments; -import io.avaje.http.generator.core.UType; -import io.avaje.http.generator.core.WebMethod; +import io.avaje.http.generator.core.*; import io.avaje.http.generator.core.openapi.MediaType; import javax.lang.model.type.TypeMirror; @@ -67,8 +60,10 @@ final class ControllerMethodWriter { private final boolean useJsonB; private final boolean instrumentContext; private final boolean isFilter; + private final ControllerReader reader; - ControllerMethodWriter(MethodReader method, Append writer, boolean useJsonB) { + ControllerMethodWriter(MethodReader method, Append writer, boolean useJsonB, ControllerReader reader) { + this.reader = reader; this.method = method; this.writer = writer; this.webMethod = method.webMethod(); @@ -92,10 +87,35 @@ void writeRule() { } else if (isFilter) { writer.append(" routing.addFilter(this::_%s);", method.simpleName()).eol(); } else { - writer.append(" routing.%s(\"%s\", this::_%s);", webMethod.name().toLowerCase(), method.fullPath().replace("\\", "\\\\"), method.simpleName()).eol(); + writer.append(" routing.%s(\"%s\", ", webMethod.name().toLowerCase(), method.fullPath().replace("\\", "\\\\")); + var hxRequest = method.hxRequest(); + if (hxRequest != null) { + writer.append("HxHandler.builder(this::_%s)", method.simpleName()); + if (hasValue(hxRequest.target())) { + writer.append(".target(\"%s\")", hxRequest.target()); + } + if (hasValue(hxRequest.triggerId())) { + writer.append(".trigger(\"%s\")", hxRequest.triggerId()); + } else if (hasValue(hxRequest.value())) { + writer.append(".trigger(\"%s\")", hxRequest.value()); + } + if (hasValue(hxRequest.triggerName())) { + writer.append(".triggerName(\"%s\")", hxRequest.triggerName()); + } else if (hasValue(hxRequest.value())) { + writer.append(".triggerName(\"%s\")", hxRequest.value()); + } + writer.append(".build());").eol(); + + } else { + writer.append("this::_%s);", method.simpleName()).eol(); + } } } + private static boolean hasValue(String value) { + return value != null && !value.isBlank(); + } + void writeHandler(boolean requestScoped) { if (method.isErrorMethod()) { writer.append(" private void _%s(ServerRequest req, ServerResponse res, %s ex) {", method.simpleName(), method.exceptionShortName()).eol(); @@ -205,6 +225,8 @@ void writeHandler(boolean requestScoped) { final var uType = UType.parse(method.returnType()); writer.append(indent).append("%sJsonType.toJson(result, JsonOutput.of(res));", uType.shortName()).eol(); } + } else if (useTemplating()) { + writer.append(indent).append("renderer.render(result, req, res);").eol(); } else { writer.append(indent).append("res.send(result);").eol(); } @@ -215,6 +237,12 @@ void writeHandler(boolean requestScoped) { writer.append(" }").eol().eol(); } + private boolean useTemplating() { + return reader.html() + && !"byte[]".equals(method.returnType().toString()) + && (method.produces() == null || method.produces().toLowerCase().contains("html")); + } + private static boolean isExceptionOrFilterChain(MethodParam param) { return isAssignable2Interface(param.utype().mainType(), "java.lang.Exception") || "FilterChain".equals(param.shortType()); diff --git a/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java b/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java index e192f9d0..e3254ba3 100644 --- a/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java +++ b/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.util.List; import java.util.Map; +import java.util.Objects; import io.avaje.http.generator.core.BaseControllerWriter; import io.avaje.http.generator.core.Constants; @@ -59,6 +60,14 @@ class ControllerWriter extends BaseControllerWriter { reader.addImportType("io.helidon.webserver.http.RoutingRequest"); reader.addImportType("io.helidon.webserver.http.RoutingResponse"); } + if (reader.methods().stream() + .map(MethodReader::hxRequest) + .anyMatch(Objects::nonNull)) { + reader.addImportType("io.avaje.htmx.nima.HxHandler"); + } + if (reader.html()) { + reader.addImportType("io.avaje.htmx.nima.TemplateRender"); + } } void write() { @@ -80,7 +89,7 @@ protected void writeImports() { private List writerMethods() { return reader.methods().stream() .filter(MethodReader::isWebMethod) - .map(it -> new ControllerMethodWriter(it, writer, useJsonB)) + .map(it -> new ControllerMethodWriter(it, writer, useJsonB, reader)) .toList(); } @@ -126,10 +135,12 @@ private void writeClassStart() { if (reader.isIncludeValidator()) { writer.append(" private final Validator validator;").eol(); } - if (instrumentContext) { writer.append(" private final RequestContextResolver resolver;").eol(); } + if (reader.html()) { + writer.append(" private final TemplateRender renderer;").eol(); + } for (final UType type : jsonTypes.values()) { if (!isInputStream(type.full())) { @@ -146,6 +157,9 @@ private void writeClassStart() { if (useJsonB) { writer.append(", Jsonb jsonb"); } + if (reader.html()) { + writer.append(", TemplateRender renderer"); + } if (instrumentContext) { writer.append(", RequestContextResolver resolver"); } @@ -155,6 +169,9 @@ private void writeClassStart() { if (reader.isIncludeValidator()) { writer.append(" this.validator = validator;").eol(); } + if (reader.html()) { + writer.append(" this.renderer = renderer;").eol(); + } if (instrumentContext) { writer.append(" this.resolver = resolver;").eol(); } @@ -176,6 +193,6 @@ private void writeClassStart() { } private boolean isInputStream(String type) { - return isAssignable2Interface(type.toString(), "java.io.InputStream"); + return isAssignable2Interface(type, "java.io.InputStream"); } } diff --git a/pom.xml b/pom.xml index 34d114bc..4bfa390f 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,7 @@ + htmx-api http-api http-api-javalin http-client @@ -63,9 +64,20 @@ [21,22] + htmx-nima + htmx-nima-jstache http-generator-helidon + + test21 + + htmx-nima + htmx-nima-jstache + http-generator-helidon + tests + + module-info.shade diff --git a/tests/pom.xml b/tests/pom.xml index c4173ff3..449c3b84 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -38,6 +38,7 @@ test-nima test-nima-jsonb + test-nima-htmx diff --git a/tests/test-nima-htmx/pom.xml b/tests/test-nima-htmx/pom.xml new file mode 100644 index 00000000..2316c1bb --- /dev/null +++ b/tests/test-nima-htmx/pom.xml @@ -0,0 +1,100 @@ + + + 4.0.0 + + io.avaje + tests + 2.7 + + + test-nima-htmx + + + 21 + UTF-8 + false + 1.3.5 + + + + + io.avaje + avaje-inject + ${avaje-inject.version} + + + io.avaje + avaje-htmx-nima-jstache + ${project.version} + + + io.jstach + jstachio + ${io.jstach.version} + + + io.avaje + avaje-htmx-api + ${project.version} + + + io.avaje + avaje-htmx-nima + ${project.version} + + + io.avaje + avaje-nima + 1.0 + + + + + io.avaje + avaje-nima-test + 1.0 + test + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.11.0 + + 21 + + + io.avaje + avaje-http-helidon-generator + ${project.version} + + + io.avaje + avaje-inject-generator + ${avaje-inject.version} + + + io.avaje + avaje-jsonb-generator + 1.11 + + + io.jstach + jstachio-apt + ${io.jstach.version} + + + + + + + + + + diff --git a/tests/test-nima-htmx/src/main/java/org/example/htmx/Main.java b/tests/test-nima-htmx/src/main/java/org/example/htmx/Main.java new file mode 100644 index 00000000..1b6d205a --- /dev/null +++ b/tests/test-nima-htmx/src/main/java/org/example/htmx/Main.java @@ -0,0 +1,15 @@ +package org.example.htmx; + +import io.avaje.inject.InjectModule; +import io.avaje.nima.Nima; + +@InjectModule(name = "hxTest") +public class Main { + + public static void main(String[] args) { + Nima.builder() + .port(8090) + .build() + .start(); + } +} diff --git a/tests/test-nima-htmx/src/main/java/org/example/htmx/UIController.java b/tests/test-nima-htmx/src/main/java/org/example/htmx/UIController.java new file mode 100644 index 00000000..05c59ded --- /dev/null +++ b/tests/test-nima-htmx/src/main/java/org/example/htmx/UIController.java @@ -0,0 +1,29 @@ +package org.example.htmx; + +import io.avaje.htmx.api.Html; +import io.avaje.htmx.api.HxRequest; +import io.avaje.http.api.Controller; +import io.avaje.http.api.Get; +import io.avaje.http.api.Path; + +import java.time.Instant; +import java.util.List; + +@Html +@Controller +@Path("/") +public class UIController { + + @Get + ViewHome index() { + return new ViewHome("Robin3"); + } + + @HxRequest(target = "name") + @Get("name") + ViewName name() { + var mlist = List.of("one","two","three", "four"); + return new ViewName("JimBolin", Instant.now(), "MoreMeMore", mlist); + } + +} diff --git a/tests/test-nima-htmx/src/main/java/org/example/htmx/ViewHome.java b/tests/test-nima-htmx/src/main/java/org/example/htmx/ViewHome.java new file mode 100644 index 00000000..607dc690 --- /dev/null +++ b/tests/test-nima-htmx/src/main/java/org/example/htmx/ViewHome.java @@ -0,0 +1,7 @@ +package org.example.htmx; + +import io.jstach.jstache.JStache; + +@JStache(path = "home") +public record ViewHome(String name) { +} diff --git a/tests/test-nima-htmx/src/main/java/org/example/htmx/ViewName.java b/tests/test-nima-htmx/src/main/java/org/example/htmx/ViewName.java new file mode 100644 index 00000000..2cda3b0c --- /dev/null +++ b/tests/test-nima-htmx/src/main/java/org/example/htmx/ViewName.java @@ -0,0 +1,13 @@ +package org.example.htmx; + +import io.jstach.jstache.JStache; + +import java.time.Instant; +import java.util.List; + +@JStache(path = "name") +public record ViewName(String name, Instant foo, String more, List mlist) { + public String when() { + return foo.toString(); + } +} diff --git a/tests/test-nima-htmx/src/main/java/org/example/htmx/package-info.java b/tests/test-nima-htmx/src/main/java/org/example/htmx/package-info.java new file mode 100644 index 00000000..a0e8d10d --- /dev/null +++ b/tests/test-nima-htmx/src/main/java/org/example/htmx/package-info.java @@ -0,0 +1,4 @@ +@JStachePath(prefix = "ui/", suffix = ".mustache") +package org.example.htmx; + +import io.jstach.jstache.JStachePath; diff --git a/tests/test-nima-htmx/src/main/java/org/example/htmx/template/JstacheTemplateRender.java b/tests/test-nima-htmx/src/main/java/org/example/htmx/template/JstacheTemplateRender.java new file mode 100644 index 00000000..4acb8ed0 --- /dev/null +++ b/tests/test-nima-htmx/src/main/java/org/example/htmx/template/JstacheTemplateRender.java @@ -0,0 +1,17 @@ +package org.example.htmx.template; + +import io.avaje.htmx.nima.TemplateRender; +import io.avaje.inject.Component; +import io.helidon.webserver.http.ServerRequest; +import io.helidon.webserver.http.ServerResponse; +import io.jstach.jstachio.JStachio; + +@Component +public class JstacheTemplateRender implements TemplateRender { + + @Override + public void render(Object viewModel, ServerRequest req, ServerResponse res) { + String content = JStachio.render(viewModel); + res.send(content); + } +} diff --git a/tests/test-nima-htmx/src/main/resources/ui/fragments/layout.mustache b/tests/test-nima-htmx/src/main/resources/ui/fragments/layout.mustache new file mode 100644 index 00000000..26a8c9e8 --- /dev/null +++ b/tests/test-nima-htmx/src/main/resources/ui/fragments/layout.mustache @@ -0,0 +1,11 @@ + + + + Hi + + + +

Heading

+{{$body}}Empty body{{/body}} + + diff --git a/tests/test-nima-htmx/src/main/resources/ui/home.mustache b/tests/test-nima-htmx/src/main/resources/ui/home.mustache new file mode 100644 index 00000000..af468658 --- /dev/null +++ b/tests/test-nima-htmx/src/main/resources/ui/home.mustache @@ -0,0 +1,8 @@ +{{ + Hi there {{ name }} + + +{{/body}} +{{/fragments/layout}} diff --git a/tests/test-nima-htmx/src/main/resources/ui/name.mustache b/tests/test-nima-htmx/src/main/resources/ui/name.mustache new file mode 100644 index 00000000..4c2f0f85 --- /dev/null +++ b/tests/test-nima-htmx/src/main/resources/ui/name.mustache @@ -0,0 +1,6 @@ +
+Yond {{ name }} its {{ when }} !! and {{ more }} sad + {{#mlist}} + in {{.}} ot + {{/mlist}} +
diff --git a/tests/test-nima-jsonb/src/main/java/org/example/path/nest/PathNestController.java b/tests/test-nima-jsonb/src/main/java/org/example/htmx/PathNestController.java similarity index 92% rename from tests/test-nima-jsonb/src/main/java/org/example/path/nest/PathNestController.java rename to tests/test-nima-jsonb/src/main/java/org/example/htmx/PathNestController.java index 47fb7479..dcc7aa3e 100644 --- a/tests/test-nima-jsonb/src/main/java/org/example/path/nest/PathNestController.java +++ b/tests/test-nima-jsonb/src/main/java/org/example/htmx/PathNestController.java @@ -1,4 +1,4 @@ -package org.example.path.nest; +package org.example.htmx; import io.avaje.http.api.Controller; import io.avaje.http.api.Get; diff --git a/tests/test-nima-jsonb/src/main/java/org/example/path/nest/package-info.java b/tests/test-nima-jsonb/src/main/java/org/example/htmx/package-info.java similarity index 61% rename from tests/test-nima-jsonb/src/main/java/org/example/path/nest/package-info.java rename to tests/test-nima-jsonb/src/main/java/org/example/htmx/package-info.java index 73f306ff..d9695fca 100644 --- a/tests/test-nima-jsonb/src/main/java/org/example/path/nest/package-info.java +++ b/tests/test-nima-jsonb/src/main/java/org/example/htmx/package-info.java @@ -1,5 +1,5 @@ @Path("nested") -package org.example.path.nest; +package org.example.htmx; import io.avaje.http.api.Path; diff --git a/tests/test-nima-jsonb/src/main/java/org/example/path/PathTestController.java b/tests/test-nima-jsonb/src/main/java/org/example/path/PathTestController.java index 5d1a3f97..2421bd26 100644 --- a/tests/test-nima-jsonb/src/main/java/org/example/path/PathTestController.java +++ b/tests/test-nima-jsonb/src/main/java/org/example/path/PathTestController.java @@ -1,6 +1,6 @@ package org.example.path; -import org.example.path.nest.PathNestController.NestedTypeResponse; +import org.example.htmx.PathNestController.NestedTypeResponse; import io.avaje.http.api.Controller; import io.avaje.http.api.Get; From 62e717e285c5fdf22c036e9c5b050735c3ca77e4 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Tue, 13 Aug 2024 23:36:26 +1200 Subject: [PATCH 41/54] Disable EA stable build (as download broken) --- .github/workflows/jdk-ea-stable.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/jdk-ea-stable.yml b/.github/workflows/jdk-ea-stable.yml index a6c44f00..6f2383e6 100644 --- a/.github/workflows/jdk-ea-stable.yml +++ b/.github/workflows/jdk-ea-stable.yml @@ -2,11 +2,11 @@ name: JDK EA Stable on: - push: - pull_request: workflow_dispatch: - schedule: - - cron: '39 1 * * 1,3,5' +# push: +# pull_request: +# schedule: +# - cron: '39 1 * * 1,3,5' jobs: build: From 8a57e69d14810436e0339add68e28af11985f529 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Tue, 13 Aug 2024 23:37:51 +1200 Subject: [PATCH 42/54] Version 2.8-RC1 --- htmx-api/pom.xml | 2 +- htmx-nima-jstache/pom.xml | 2 +- htmx-nima/pom.xml | 4 ++-- http-api-javalin/pom.xml | 2 +- http-api/pom.xml | 2 +- http-client-gson-adapter/pom.xml | 4 ++-- http-client-moshi-adapter/pom.xml | 4 ++-- http-client/pom.xml | 4 ++-- http-generator-client/pom.xml | 2 +- http-generator-core/pom.xml | 2 +- http-generator-helidon/pom.xml | 2 +- http-generator-javalin/pom.xml | 2 +- http-generator-jex/pom.xml | 2 +- http-inject-plugin/pom.xml | 2 +- pom.xml | 2 +- tests/pom.xml | 2 +- tests/test-client-generation/pom.xml | 2 +- tests/test-client/pom.xml | 2 +- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-javalin/pom.xml | 2 +- tests/test-jex/pom.xml | 2 +- tests/test-nima-htmx/pom.xml | 2 +- tests/test-nima-jsonb/pom.xml | 2 +- tests/test-nima/pom.xml | 2 +- 24 files changed, 28 insertions(+), 28 deletions(-) diff --git a/htmx-api/pom.xml b/htmx-api/pom.xml index ad4b7e30..9f086a83 100644 --- a/htmx-api/pom.xml +++ b/htmx-api/pom.xml @@ -6,7 +6,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 avaje-htmx-api diff --git a/htmx-nima-jstache/pom.xml b/htmx-nima-jstache/pom.xml index 3305f71c..80c3976f 100644 --- a/htmx-nima-jstache/pom.xml +++ b/htmx-nima-jstache/pom.xml @@ -6,7 +6,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 avaje-htmx-nima-jstache diff --git a/htmx-nima/pom.xml b/htmx-nima/pom.xml index bc405cfe..89c2870f 100644 --- a/htmx-nima/pom.xml +++ b/htmx-nima/pom.xml @@ -6,7 +6,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 avaje-htmx-nima @@ -21,7 +21,7 @@ io.avaje avaje-htmx-api - 2.7 + 2.8-RC1 io.helidon.webserver diff --git a/http-api-javalin/pom.xml b/http-api-javalin/pom.xml index ac78d243..9f3b18bd 100644 --- a/http-api-javalin/pom.xml +++ b/http-api-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 .. diff --git a/http-api/pom.xml b/http-api/pom.xml index 4c5548bd..b8a42510 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 .. diff --git a/http-client-gson-adapter/pom.xml b/http-client-gson-adapter/pom.xml index 87d5d4fd..099a2b05 100644 --- a/http-client-gson-adapter/pom.xml +++ b/http-client-gson-adapter/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 avaje-http-client-gson @@ -20,7 +20,7 @@ io.avaje avaje-http-client - 2.7 + 2.8-RC1 provided diff --git a/http-client-moshi-adapter/pom.xml b/http-client-moshi-adapter/pom.xml index e0e01a11..f5cd2899 100644 --- a/http-client-moshi-adapter/pom.xml +++ b/http-client-moshi-adapter/pom.xml @@ -3,7 +3,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 avaje-http-client-moshi @@ -19,7 +19,7 @@ io.avaje avaje-http-client - 2.7 + 2.8-RC1 provided diff --git a/http-client/pom.xml b/http-client/pom.xml index b0a81dd9..d05286f0 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 avaje-http-client @@ -66,7 +66,7 @@ io.avaje avaje-http-api - 2.7 + 2.8-RC1 test diff --git a/http-generator-client/pom.xml b/http-generator-client/pom.xml index 85186fad..a662b44a 100644 --- a/http-generator-client/pom.xml +++ b/http-generator-client/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 avaje-http-client-generator diff --git a/http-generator-core/pom.xml b/http-generator-core/pom.xml index 2f386802..0b730af1 100644 --- a/http-generator-core/pom.xml +++ b/http-generator-core/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 avaje-http-generator-core diff --git a/http-generator-helidon/pom.xml b/http-generator-helidon/pom.xml index 3d5349a2..8fb09b39 100644 --- a/http-generator-helidon/pom.xml +++ b/http-generator-helidon/pom.xml @@ -4,7 +4,7 @@ avaje-http-parent io.avaje - 2.7 + 2.8-RC1 avaje-http-helidon-generator diff --git a/http-generator-javalin/pom.xml b/http-generator-javalin/pom.xml index 39649461..1985a057 100644 --- a/http-generator-javalin/pom.xml +++ b/http-generator-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 avaje-http-javalin-generator diff --git a/http-generator-jex/pom.xml b/http-generator-jex/pom.xml index ebd49a79..f77bac53 100644 --- a/http-generator-jex/pom.xml +++ b/http-generator-jex/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 avaje-http-jex-generator diff --git a/http-inject-plugin/pom.xml b/http-inject-plugin/pom.xml index 732c22b5..d13cf829 100644 --- a/http-inject-plugin/pom.xml +++ b/http-inject-plugin/pom.xml @@ -4,7 +4,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 .. diff --git a/pom.xml b/pom.xml index 4bfa390f..05a50c36 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ io.avaje avaje-http-parent - 2.7 + 2.8-RC1 pom diff --git a/tests/pom.xml b/tests/pom.xml index 449c3b84..7082e733 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -4,7 +4,7 @@ avaje-http-parent io.avaje - 2.7 + 2.8-RC1 tests diff --git a/tests/test-client-generation/pom.xml b/tests/test-client-generation/pom.xml index ee5c1e62..a1d6ba4d 100644 --- a/tests/test-client-generation/pom.xml +++ b/tests/test-client-generation/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.7 + 2.8-RC1 test-client-generation diff --git a/tests/test-client/pom.xml b/tests/test-client/pom.xml index f0750b0f..70285d69 100644 --- a/tests/test-client/pom.xml +++ b/tests/test-client/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.7 + 2.8-RC1 test-client diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index e628758a..d130f7a8 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -5,7 +5,7 @@ io.avaje tests - 2.7 + 2.8-RC1 test-javalin-jsonb diff --git a/tests/test-javalin/pom.xml b/tests/test-javalin/pom.xml index d2e89b31..ee0919f2 100644 --- a/tests/test-javalin/pom.xml +++ b/tests/test-javalin/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.7 + 2.8-RC1 test-javalin diff --git a/tests/test-jex/pom.xml b/tests/test-jex/pom.xml index e93722d1..7625ec2e 100644 --- a/tests/test-jex/pom.xml +++ b/tests/test-jex/pom.xml @@ -4,7 +4,7 @@ io.avaje tests - 2.7 + 2.8-RC1 test-jex diff --git a/tests/test-nima-htmx/pom.xml b/tests/test-nima-htmx/pom.xml index 2316c1bb..65bbc43c 100644 --- a/tests/test-nima-htmx/pom.xml +++ b/tests/test-nima-htmx/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.7 + 2.8-RC1 test-nima-htmx diff --git a/tests/test-nima-jsonb/pom.xml b/tests/test-nima-jsonb/pom.xml index 9c54fb44..5d0fe320 100644 --- a/tests/test-nima-jsonb/pom.xml +++ b/tests/test-nima-jsonb/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.7 + 2.8-RC1 test-nima-jsonb diff --git a/tests/test-nima/pom.xml b/tests/test-nima/pom.xml index a27501e1..ba385f43 100644 --- a/tests/test-nima/pom.xml +++ b/tests/test-nima/pom.xml @@ -6,7 +6,7 @@ io.avaje tests - 2.7 + 2.8-RC1 test-nima From 5d50ef56b5f98c4597fd8f8c64fc1c92bb5ffba8 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Mon, 19 Aug 2024 08:37:31 +1200 Subject: [PATCH 43/54] Add htmx content cache feature (#484) --- .../java/io/avaje/htmx/api/ContentCache.java | 16 ++++ .../nima/jstache/DefaultTemplateProvider.java | 4 +- .../nima/jstache/JStacheTemplateRender.java | 7 +- .../htmx/nima/jstache/SimpleContentCache.java | 31 +++++++ .../avaje/htmx/nima/TemplateContentCache.java | 30 ++++++ .../io/avaje/htmx/nima/TemplateRender.java | 6 +- .../http/generator/core/ControllerReader.java | 20 +++- .../http/generator/core/MethodReader.java | 13 ++- .../generator/core/openapi/MediaType.java | 1 + .../http/generator/core/package-info.java | 1 + .../helidon/nima/ControllerMethodWriter.java | 92 +++++++++++++++---- .../helidon/nima/ControllerWriter.java | 15 +++ .../java/org/example/htmx/UIController.java | 3 + .../htmx/template/JstacheTemplateRender.java | 7 +- .../htmx/template/SimpleContentCache.java | 33 +++++++ 15 files changed, 240 insertions(+), 39 deletions(-) create mode 100644 htmx-api/src/main/java/io/avaje/htmx/api/ContentCache.java create mode 100644 htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/SimpleContentCache.java create mode 100644 htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateContentCache.java create mode 100644 tests/test-nima-htmx/src/main/java/org/example/htmx/template/SimpleContentCache.java diff --git a/htmx-api/src/main/java/io/avaje/htmx/api/ContentCache.java b/htmx-api/src/main/java/io/avaje/htmx/api/ContentCache.java new file mode 100644 index 00000000..56a8b210 --- /dev/null +++ b/htmx-api/src/main/java/io/avaje/htmx/api/ContentCache.java @@ -0,0 +1,16 @@ +package io.avaje.htmx.api; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Mark a controller method as using a content cache. + */ +@Target(METHOD) +@Retention(RUNTIME) +public @interface ContentCache { + +} diff --git a/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java index 342e2bd4..41fc8161 100644 --- a/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java +++ b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java @@ -1,5 +1,6 @@ package io.avaje.htmx.nima.jstache; +import io.avaje.htmx.nima.TemplateContentCache; import io.avaje.htmx.nima.TemplateRender; import io.avaje.inject.BeanScopeBuilder; import io.avaje.inject.spi.Plugin; @@ -11,11 +12,12 @@ public final class DefaultTemplateProvider implements Plugin { @Override public Class[] provides() { - return new Class[]{TemplateRender.class}; + return new Class[]{TemplateRender.class, TemplateContentCache.class}; } @Override public void apply(BeanScopeBuilder builder) { builder.provideDefault(null, TemplateRender.class, JStacheTemplateRender::new); + builder.provideDefault(null, TemplateContentCache.class, SimpleContentCache::new); } } diff --git a/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/JStacheTemplateRender.java b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/JStacheTemplateRender.java index beb4bff6..7b5b7029 100644 --- a/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/JStacheTemplateRender.java +++ b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/JStacheTemplateRender.java @@ -1,15 +1,12 @@ package io.avaje.htmx.nima.jstache; import io.avaje.htmx.nima.TemplateRender; -import io.helidon.webserver.http.ServerRequest; -import io.helidon.webserver.http.ServerResponse; import io.jstach.jstachio.JStachio; public final class JStacheTemplateRender implements TemplateRender { @Override - public void render(Object viewModel, ServerRequest req, ServerResponse res) { - var content = JStachio.render(viewModel); - res.send(content); + public String render(Object viewModel) { + return JStachio.render(viewModel); } } diff --git a/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/SimpleContentCache.java b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/SimpleContentCache.java new file mode 100644 index 00000000..aaa64b6a --- /dev/null +++ b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/SimpleContentCache.java @@ -0,0 +1,31 @@ +package io.avaje.htmx.nima.jstache; + +import io.avaje.htmx.nima.TemplateContentCache; +import io.helidon.webserver.http.ServerRequest; + +import java.util.concurrent.ConcurrentHashMap; + +public class SimpleContentCache implements TemplateContentCache { + + private final ConcurrentHashMap localCache = new ConcurrentHashMap<>(); + + @Override + public String key(ServerRequest req) { + return req.requestedUri().path().rawPath(); + } + + @Override + public String key(ServerRequest req, Object formParams) { + return req.requestedUri().path().rawPath() + formParams; + } + + @Override + public String content(String key) { + return localCache.get(key); + } + + @Override + public void contentPut(String key, String content) { + localCache.put(key, content); + } +} diff --git a/htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateContentCache.java b/htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateContentCache.java new file mode 100644 index 00000000..83a8a60e --- /dev/null +++ b/htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateContentCache.java @@ -0,0 +1,30 @@ +package io.avaje.htmx.nima; + +import io.helidon.webserver.http.ServerRequest; + +/** + * Defines caching of template content. + */ +public interface TemplateContentCache { + + /** + * Return the key given the request. + */ + String key(ServerRequest req); + + /** + * Return the key given the request with form parameters. + */ + String key(ServerRequest req, Object formParams); + + /** + * Return the content given the key. + */ + String content(String key); + + /** + * Put the content into the cache. + */ + void contentPut(String key, String content); + +} diff --git a/htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateRender.java b/htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateRender.java index 4cc1a62f..fa69f00f 100644 --- a/htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateRender.java +++ b/htmx-nima/src/main/java/io/avaje/htmx/nima/TemplateRender.java @@ -1,9 +1,5 @@ package io.avaje.htmx.nima; - -import io.helidon.webserver.http.ServerRequest; -import io.helidon.webserver.http.ServerResponse; - /** * Template render API for Helidon. */ @@ -12,5 +8,5 @@ public interface TemplateRender { /** * Render the given template view model to the server response. */ - void render(Object viewModel, ServerRequest req, ServerResponse res); + String render(Object viewModel); } diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/ControllerReader.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/ControllerReader.java index 12e89fdd..2e5cd9dc 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/ControllerReader.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/ControllerReader.java @@ -49,6 +49,8 @@ public final class ControllerReader { private final boolean hasValid; /** Set true via {@code @Html} to indicate use of Templating */ private final boolean html; + /** Set true via {@code @ContentCache} to indicate use of Templating content cache */ + private boolean hasContentCache; private boolean methodHasValid; /** @@ -200,6 +202,10 @@ public boolean html() { return html; } + public boolean hasContentCache() { + return hasContentCache; + } + public TypeElement beanType() { return beanType; } @@ -247,10 +253,11 @@ public void read(boolean withSingleton) { } private void deriveIncludeValidation() { - methodHasValid = methodHasValid(); + methodHasValid = anyMethodHasValid(); + hasContentCache = anyMethodHasContentCache(); } - private boolean methodHasValid() { + private boolean anyMethodHasValid() { for (final MethodReader method : methods) { if (method.hasValid()) { return true; @@ -259,6 +266,15 @@ private boolean methodHasValid() { return false; } + private boolean anyMethodHasContentCache() { + for (final MethodReader method : methods) { + if (method.hasContentCache()) { + return true; + } + } + return false; + } + private void readField(Element element) { if (!requestScope) { final String rawType = element.asType().toString(); diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/MethodReader.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/MethodReader.java index e679f267..d427b57b 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/MethodReader.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/MethodReader.java @@ -41,6 +41,7 @@ public class MethodReader { private final List actualParams; private final PathSegments pathSegments; private final boolean hasValid; + private final Optional contentCache; private final List superMethods; private final Optional timeout; private final HxRequestPrism hxRequest; @@ -87,10 +88,12 @@ public class MethodReader { }); if (isWebMethod()) { this.hasValid = initValid(); + this.contentCache = initContentCache(); this.instrumentContext = initResolver(); this.pathSegments = PathSegments.parse(Util.combinePath(bean.path(), webMethodPath)); } else { this.hasValid = false; + this.contentCache = Optional.empty(); this.pathSegments = null; this.instrumentContext = false; } @@ -124,7 +127,11 @@ private boolean initValid() { private boolean superMethodHasValid() { return superMethods.stream() - .anyMatch(e -> findAnnotation(ValidPrism::getOptionalOn).isPresent()); + .anyMatch(e -> findAnnotation(ValidPrism::getOptionalOn).isPresent()); + } + + private Optional initContentCache() { + return findAnnotation(ContentCachePrism::getOptionalOn); } @Override @@ -413,6 +420,10 @@ boolean hasValid() { return hasValid; } + public boolean hasContentCache() { + return contentCache.isPresent(); + } + public String simpleName() { return element.getSimpleName().toString(); } diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/openapi/MediaType.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/openapi/MediaType.java index 331488cf..e4af9c89 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/openapi/MediaType.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/openapi/MediaType.java @@ -4,6 +4,7 @@ public enum MediaType { APPLICATION_JSON("application/json"), TEXT_PLAIN("text/plain"), TEXT_HTML("text/html"), + HTML_UTF8("text/html;charset=UTF8"), UNKNOWN(""); private final String value; diff --git a/http-generator-core/src/main/java/io/avaje/http/generator/core/package-info.java b/http-generator-core/src/main/java/io/avaje/http/generator/core/package-info.java index efdbc260..5300dda1 100644 --- a/http-generator-core/src/main/java/io/avaje/http/generator/core/package-info.java +++ b/http-generator-core/src/main/java/io/avaje/http/generator/core/package-info.java @@ -36,6 +36,7 @@ @GeneratePrism(value = io.avaje.http.api.RequestTimeout.class, publicAccess = true) @GeneratePrism(value = io.avaje.htmx.api.HxRequest.class, publicAccess = true) @GeneratePrism(value = io.avaje.htmx.api.Html.class, publicAccess = true) +@GeneratePrism(value = io.avaje.htmx.api.ContentCache.class, publicAccess = true) package io.avaje.http.generator.core; import io.avaje.prism.GeneratePrism; diff --git a/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerMethodWriter.java b/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerMethodWriter.java index ee7bf699..5afa9874 100644 --- a/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerMethodWriter.java +++ b/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerMethodWriter.java @@ -131,7 +131,7 @@ void writeHandler(boolean requestScoped) { writer.append(" res.status(%s);", lookupStatusCode(statusCode)).eol(); } } - + boolean withFormParams = false; final var bodyType = method.bodyType(); if (bodyType != null && !method.isErrorMethod() && !isFilter) { if ("InputStream".equals(bodyType)) { @@ -144,26 +144,41 @@ void writeHandler(boolean requestScoped) { } else { defaultHelidonBodyContent(); } - } else if (usesFormParams()) { - writer.append(" var formParams = req.content().as(Parameters.class);").eol(); + } else { + withFormParams = usesFormParams(); + if (withFormParams) { + writer.append(" var formParams = req.content().as(Parameters.class);").eol(); + } + } + final ResponseMode responseMode = responseMode(); + final boolean withContentCache = responseMode == ResponseMode.Templating && useContentCache(); + if (withContentCache) { + writer.append(" var key = contentCache.key(req"); + if (withFormParams) { + writer.append(", formParams"); + } + writer.append(");").eol(); + writer.append(" var cacheContent = contentCache.content(key);").eol(); + writer.append(" if (cacheContent != null) {").eol(); + writeContextReturn(" "); + writer.append(" res.send(cacheContent);").eol(); + writer.append(" return;").eol(); + writer.append(" }").eol(); } final var segments = method.pathSegments(); if (segments.fullPath().contains("{")) { writer.append(" var pathParams = req.path().pathParameters();").eol(); } - for (final PathSegments.Segment matrixSegment : segments.matrixSegments()) { matrixSegment.writeCreateSegment(writer, platform()); } - final var params = method.params(); for (final MethodParam param : params) { if (!isExceptionOrFilterChain(param)) { param.writeCtxGet(writer, segments); } } - if (method.includeValidate()) { for (final MethodParam param : params) { param.writeValidate(writer); @@ -205,7 +220,7 @@ void writeHandler(boolean requestScoped) { } writer.append(");").eol(); - if (!method.isVoid() && !isFilter) { + if (responseMode != ResponseMode.Void) { TypeMirror typeMirror = method.returnType(); boolean includeNoContent = !typeMirror.getKind().isPrimitive(); if (includeNoContent) { @@ -214,21 +229,29 @@ void writeHandler(boolean requestScoped) { writer.append(" } else {").eol(); } String indent = includeNoContent ? " " : " "; - writeContextReturn(indent); - if (isInputStream(method.returnType())) { - final var uType = UType.parse(method.returnType()); - writer.append(indent).append("result.transferTo(res.outputStream());", uType.shortName()).eol(); - } else if (producesJson()) { - if (returnTypeString()) { - writer.append(indent).append("res.send(result); // send raw JSON").eol(); - } else { - final var uType = UType.parse(method.returnType()); - writer.append(indent).append("%sJsonType.toJson(result, JsonOutput.of(res));", uType.shortName()).eol(); + if (responseMode == ResponseMode.Templating) { + writer.append(indent).append("var content = renderer.render(result);").eol(); + if (withContentCache) { + writer.append(indent).append("contentCache.contentPut(key, content);").eol(); } - } else if (useTemplating()) { - writer.append(indent).append("renderer.render(result, req, res);").eol(); + writeContextReturn(indent); + writer.append(indent).append("res.send(content);").eol(); + } else { - writer.append(indent).append("res.send(result);").eol(); + writeContextReturn(indent); + if (responseMode == ResponseMode.InputStream) { + final var uType = UType.parse(method.returnType()); + writer.append(indent).append("result.transferTo(res.outputStream());", uType.shortName()).eol(); + } else if (responseMode == ResponseMode.Json) { + if (returnTypeString()) { + writer.append(indent).append("res.send(result); // send raw JSON").eol(); + } else { + final var uType = UType.parse(method.returnType()); + writer.append(indent).append("%sJsonType.toJson(result, JsonOutput.of(res));", uType.shortName()).eol(); + } + } else { + writer.append(indent).append("res.send(result);").eol(); + } } if (includeNoContent) { writer.append(" }").eol(); @@ -237,6 +260,34 @@ void writeHandler(boolean requestScoped) { writer.append(" }").eol().eol(); } + enum ResponseMode { + Void, + Json, + Templating, + InputStream, + Other + } + + ResponseMode responseMode() { + if (method.isVoid() || isFilter) { + return ResponseMode.Void; + } + if (isInputStream(method.returnType())) { + return ResponseMode.InputStream; + } + if (producesJson()) { + return ResponseMode.Json; + } + if (useTemplating()) { + return ResponseMode.Templating; + } + return ResponseMode.Other; + } + + private boolean useContentCache() { + return method.hasContentCache(); + } + private boolean useTemplating() { return reader.html() && !"byte[]".equals(method.returnType().toString()) @@ -308,6 +359,7 @@ private void writeContextReturn(String indent) { final var contentTypeString = "res.headers().contentType(MediaTypes."; writer.append(indent); switch (produces) { + case HTML_UTF8 -> writer.append("res.headers().contentType(HTML_UTF8);").eol(); case APPLICATION_JSON -> writer.append(contentTypeString).append("APPLICATION_JSON);").eol(); case TEXT_HTML -> writer.append(contentTypeString).append("TEXT_HTML);").eol(); case TEXT_PLAIN -> writer.append(contentTypeString).append("TEXT_PLAIN);").eol(); diff --git a/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java b/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java index e3254ba3..c2a39d2e 100644 --- a/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java +++ b/http-generator-helidon/src/main/java/io/avaje/http/generator/helidon/nima/ControllerWriter.java @@ -67,6 +67,9 @@ class ControllerWriter extends BaseControllerWriter { } if (reader.html()) { reader.addImportType("io.avaje.htmx.nima.TemplateRender"); + if (reader.hasContentCache()) { + reader.addImportType("io.avaje.htmx.nima.TemplateContentCache"); + } } } @@ -129,6 +132,9 @@ private void writeClassStart() { if (reader.isIncludeValidator()) { writer.append(" private static final HeaderName HEADER_ACCEPT_LANGUAGE = HeaderNames.create(\"Accept-Language\");").eol(); } + if (reader.html()) { + writer.append(" private static final io.helidon.common.media.type.MediaType HTML_UTF8 = MediaTypes.create(\"text/html;charset=UTF8\");").eol(); + } writer.append(" private final %s %s;", controllerType, controllerName).eol(); @@ -140,6 +146,9 @@ private void writeClassStart() { } if (reader.html()) { writer.append(" private final TemplateRender renderer;").eol(); + if (reader.hasContentCache()) { + writer.append(" private final TemplateContentCache contentCache;").eol(); + } } for (final UType type : jsonTypes.values()) { @@ -159,6 +168,9 @@ private void writeClassStart() { } if (reader.html()) { writer.append(", TemplateRender renderer"); + if (reader.hasContentCache()) { + writer.append(", TemplateContentCache contentCache"); + } } if (instrumentContext) { writer.append(", RequestContextResolver resolver"); @@ -171,6 +183,9 @@ private void writeClassStart() { } if (reader.html()) { writer.append(" this.renderer = renderer;").eol(); + if (reader.hasContentCache()) { + writer.append(" this.contentCache = contentCache;").eol(); + } } if (instrumentContext) { writer.append(" this.resolver = resolver;").eol(); diff --git a/tests/test-nima-htmx/src/main/java/org/example/htmx/UIController.java b/tests/test-nima-htmx/src/main/java/org/example/htmx/UIController.java index 05c59ded..482ffe03 100644 --- a/tests/test-nima-htmx/src/main/java/org/example/htmx/UIController.java +++ b/tests/test-nima-htmx/src/main/java/org/example/htmx/UIController.java @@ -1,6 +1,7 @@ package org.example.htmx; import io.avaje.htmx.api.Html; +import io.avaje.htmx.api.ContentCache; import io.avaje.htmx.api.HxRequest; import io.avaje.http.api.Controller; import io.avaje.http.api.Get; @@ -14,11 +15,13 @@ @Path("/") public class UIController { + @ContentCache @Get ViewHome index() { return new ViewHome("Robin3"); } + @ContentCache @HxRequest(target = "name") @Get("name") ViewName name() { diff --git a/tests/test-nima-htmx/src/main/java/org/example/htmx/template/JstacheTemplateRender.java b/tests/test-nima-htmx/src/main/java/org/example/htmx/template/JstacheTemplateRender.java index 4acb8ed0..ec94bf95 100644 --- a/tests/test-nima-htmx/src/main/java/org/example/htmx/template/JstacheTemplateRender.java +++ b/tests/test-nima-htmx/src/main/java/org/example/htmx/template/JstacheTemplateRender.java @@ -2,16 +2,13 @@ import io.avaje.htmx.nima.TemplateRender; import io.avaje.inject.Component; -import io.helidon.webserver.http.ServerRequest; -import io.helidon.webserver.http.ServerResponse; import io.jstach.jstachio.JStachio; @Component public class JstacheTemplateRender implements TemplateRender { @Override - public void render(Object viewModel, ServerRequest req, ServerResponse res) { - String content = JStachio.render(viewModel); - res.send(content); + public String render(Object viewModel) { + return JStachio.render(viewModel); } } diff --git a/tests/test-nima-htmx/src/main/java/org/example/htmx/template/SimpleContentCache.java b/tests/test-nima-htmx/src/main/java/org/example/htmx/template/SimpleContentCache.java new file mode 100644 index 00000000..bf175749 --- /dev/null +++ b/tests/test-nima-htmx/src/main/java/org/example/htmx/template/SimpleContentCache.java @@ -0,0 +1,33 @@ +package org.example.htmx.template; + +import io.avaje.inject.Component; +import io.avaje.htmx.nima.TemplateContentCache; +import io.helidon.webserver.http.ServerRequest; + +import java.util.concurrent.ConcurrentHashMap; + +@Component +public class SimpleContentCache implements TemplateContentCache { + + private final ConcurrentHashMap localCache = new ConcurrentHashMap<>(); + + @Override + public String key(ServerRequest req) { + return req.requestedUri().path().rawPath(); + } + + @Override + public String key(ServerRequest req, Object formParams) { + return req.requestedUri().path().rawPath() + formParams; + } + + @Override + public String content(String key) { + return localCache.get(key); + } + + @Override + public void contentPut(String key, String content) { + localCache.put(key, content); + } +} From 3e7e192a72bbaf0df95c80970b7361c139c4919d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 19:40:55 +0000 Subject: [PATCH 44/54] Bump io.jstach.version from 1.3.5 to 1.3.6 Bumps `io.jstach.version` from 1.3.5 to 1.3.6. Updates `io.jstach:jstachio` from 1.3.5 to 1.3.6 Updates `io.jstach:jstachio-apt` from 1.3.5 to 1.3.6 --- updated-dependencies: - dependency-name: io.jstach:jstachio dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.jstach:jstachio-apt dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- htmx-nima-jstache/pom.xml | 2 +- tests/test-nima-htmx/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htmx-nima-jstache/pom.xml b/htmx-nima-jstache/pom.xml index 80c3976f..86faa889 100644 --- a/htmx-nima-jstache/pom.xml +++ b/htmx-nima-jstache/pom.xml @@ -17,7 +17,7 @@ 21 UTF-8 false - 1.3.5 + 1.3.6 diff --git a/tests/test-nima-htmx/pom.xml b/tests/test-nima-htmx/pom.xml index 65bbc43c..13bb9c18 100644 --- a/tests/test-nima-htmx/pom.xml +++ b/tests/test-nima-htmx/pom.xml @@ -15,7 +15,7 @@ 21 UTF-8 false - 1.3.5 + 1.3.6 From d6ff4598eab5ddff0a808c538ca963bb9671cd48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 19:42:56 +0000 Subject: [PATCH 45/54] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.11.0 to 3.13.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.11.0...maven-compiler-plugin-3.13.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/test-nima-htmx/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-nima-htmx/pom.xml b/tests/test-nima-htmx/pom.xml index 13bb9c18..61e6903f 100644 --- a/tests/test-nima-htmx/pom.xml +++ b/tests/test-nima-htmx/pom.xml @@ -65,7 +65,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.13.0 21 From 7bf886d4ea1b863074ca133b5024fdcd728122e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 19:44:55 +0000 Subject: [PATCH 46/54] Bump io.avaje:avaje-jsonb-generator from 1.11 to 2.1 Bumps io.avaje:avaje-jsonb-generator from 1.11 to 2.1. --- updated-dependencies: - dependency-name: io.avaje:avaje-jsonb-generator dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- tests/test-nima-htmx/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-nima-htmx/pom.xml b/tests/test-nima-htmx/pom.xml index 61e6903f..30dc21e5 100644 --- a/tests/test-nima-htmx/pom.xml +++ b/tests/test-nima-htmx/pom.xml @@ -82,7 +82,7 @@ io.avaje avaje-jsonb-generator - 1.11 + 2.1 io.jstach From 440c3c0875421bcbdda452c3ec6ba7eea7585acc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 19:46:58 +0000 Subject: [PATCH 47/54] Bump io.avaje:avaje-lang from 1.0 to 1.1 Bumps [io.avaje:avaje-lang](https://github.com/avaje/avaje-lang) from 1.0 to 1.1. - [Commits](https://github.com/avaje/avaje-lang/commits) --- updated-dependencies: - dependency-name: io.avaje:avaje-lang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- htmx-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htmx-api/pom.xml b/htmx-api/pom.xml index 9f086a83..8bdc810c 100644 --- a/htmx-api/pom.xml +++ b/htmx-api/pom.xml @@ -18,7 +18,7 @@ io.avaje avaje-lang - 1.0 + 1.1 From dae77f899e79b75d3e96105d83c189e46ae40947 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 19:49:02 +0000 Subject: [PATCH 48/54] Bump nima.version from 4.0.7 to 4.1.0 Bumps `nima.version` from 4.0.7 to 4.1.0. Updates `io.helidon.webserver:helidon-webserver` from 4.0.7 to 4.1.0 Updates `io.helidon.http.media:helidon-http-media-jsonb` from 4.0.11 to 4.1.0 --- updated-dependencies: - dependency-name: io.helidon.webserver:helidon-webserver dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.helidon.http.media:helidon-http-media-jsonb dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- htmx-nima/pom.xml | 2 +- tests/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htmx-nima/pom.xml b/htmx-nima/pom.xml index 89c2870f..0598cec2 100644 --- a/htmx-nima/pom.xml +++ b/htmx-nima/pom.xml @@ -26,7 +26,7 @@ io.helidon.webserver helidon-webserver - 4.0.7 + 4.1.0 diff --git a/tests/pom.xml b/tests/pom.xml index 7082e733..d1ab571a 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -17,7 +17,7 @@ 2.17.2 2.5 10.3 - 4.0.11 + 4.1.0 6.2.0 From 03340f051cb281c9d0646af3afb90a15c678f6fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 19:51:04 +0000 Subject: [PATCH 49/54] Bump junit.version from 5.10.3 to 5.11.0 Bumps `junit.version` from 5.10.3 to 5.11.0. Updates `org.junit.jupiter:junit-jupiter-api` from 5.10.3 to 5.11.0 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.3...r5.11.0) Updates `org.junit.jupiter:junit-jupiter-engine` from 5.10.3 to 5.11.0 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.3...r5.11.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-api dependency-type: direct:development update-type: version-update:semver-minor - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pom.xml b/tests/pom.xml index d1ab571a..a7c1889b 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -12,7 +12,7 @@ true - 5.10.3 + 5.11.0 3.26.3 2.17.2 2.5 From d6c442ed440d4a9524a2b0b3287042590738d1b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 19:12:10 +0000 Subject: [PATCH 50/54] Bump io.javalin:javalin from 6.2.0 to 6.3.0 Bumps [io.javalin:javalin](https://github.com/javalin/javalin) from 6.2.0 to 6.3.0. - [Release notes](https://github.com/javalin/javalin/releases) - [Commits](https://github.com/javalin/javalin/compare/javalin-parent-6.2.0...javalin-parent-6.3.0) --- updated-dependencies: - dependency-name: io.javalin:javalin dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- http-api/pom.xml | 2 +- http-client/pom.xml | 2 +- tests/pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/http-api/pom.xml b/http-api/pom.xml index b8a42510..80efe5d3 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -24,7 +24,7 @@ io.javalin javalin - 6.2.0 + 6.3.0 provided true diff --git a/http-client/pom.xml b/http-client/pom.xml index d05286f0..c7562cc9 100644 --- a/http-client/pom.xml +++ b/http-client/pom.xml @@ -59,7 +59,7 @@ io.javalin javalin - 6.2.0 + 6.3.0 test diff --git a/tests/pom.xml b/tests/pom.xml index a7c1889b..e5b424de 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -18,7 +18,7 @@ 2.5 10.3 4.1.0 - 6.2.0 + 6.3.0 From ea4d1e8d3f0fb252bde704b36ccbef2558386fb8 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:35:41 -0400 Subject: [PATCH 51/54] Use Non-Deprecated Inject Plugin (#491) * Use non-deprecated Inject Plugin * fix module * restore EA * Update jdk-ea-stable.yml * Revert "Disable EA stable build (as download broken)" This reverts commit 62e717e285c5fdf22c036e9c5b050735c3ca77e4. * Update DefaultResolverProvider.java * correctly register the spis * Update module-info.java --- .github/workflows/jdk-ea-stable.yml | 8 ++++---- htmx-nima-jstache/pom.xml | 7 +++++++ .../avaje/htmx/nima/jstache/DefaultTemplateProvider.java | 6 ++++-- htmx-nima-jstache/src/main/java/module-info.java | 5 +++-- .../META-INF/services/io.avaje.inject.spi.Plugin | 1 - http-inject-plugin/pom.xml | 9 ++++++++- .../io/avaje/http/inject/DefaultResolverProvider.java | 6 ++++-- http-inject-plugin/src/main/java/module-info.java | 8 ++++---- .../META-INF/services/io.avaje.inject.spi.Plugin | 1 - pom.xml | 2 +- tests/pom.xml | 2 +- 11 files changed, 36 insertions(+), 19 deletions(-) delete mode 100644 htmx-nima-jstache/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin delete mode 100644 http-inject-plugin/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin diff --git a/.github/workflows/jdk-ea-stable.yml b/.github/workflows/jdk-ea-stable.yml index 6f2383e6..a6c44f00 100644 --- a/.github/workflows/jdk-ea-stable.yml +++ b/.github/workflows/jdk-ea-stable.yml @@ -2,11 +2,11 @@ name: JDK EA Stable on: + push: + pull_request: workflow_dispatch: -# push: -# pull_request: -# schedule: -# - cron: '39 1 * * 1,3,5' + schedule: + - cron: '39 1 * * 1,3,5' jobs: build: diff --git a/htmx-nima-jstache/pom.xml b/htmx-nima-jstache/pom.xml index 86faa889..522c2139 100644 --- a/htmx-nima-jstache/pom.xml +++ b/htmx-nima-jstache/pom.xml @@ -43,5 +43,12 @@ provided true + + io.avaje + avaje-spi-service + 2.5 + provided + true + diff --git a/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java index 41fc8161..c74e0f61 100644 --- a/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java +++ b/htmx-nima-jstache/src/main/java/io/avaje/htmx/nima/jstache/DefaultTemplateProvider.java @@ -3,12 +3,14 @@ import io.avaje.htmx.nima.TemplateContentCache; import io.avaje.htmx.nima.TemplateRender; import io.avaje.inject.BeanScopeBuilder; -import io.avaje.inject.spi.Plugin; +import io.avaje.inject.spi.InjectPlugin; +import io.avaje.spi.ServiceProvider; /** * Plugin for avaje inject that provides a default TemplateRender instance. */ -public final class DefaultTemplateProvider implements Plugin { +@ServiceProvider +public final class DefaultTemplateProvider implements InjectPlugin { @Override public Class[] provides() { diff --git a/htmx-nima-jstache/src/main/java/module-info.java b/htmx-nima-jstache/src/main/java/module-info.java index 2da4668b..88d58707 100644 --- a/htmx-nima-jstache/src/main/java/module-info.java +++ b/htmx-nima-jstache/src/main/java/module-info.java @@ -5,7 +5,8 @@ requires transitive io.avaje.htmx.nima; requires transitive io.helidon.webserver; requires transitive io.jstach.jstachio; - requires io.avaje.inject; + requires transitive io.avaje.inject; + requires static io.avaje.spi; - provides io.avaje.inject.spi.Plugin with io.avaje.htmx.nima.jstache.DefaultTemplateProvider; + provides io.avaje.inject.spi.InjectExtension with io.avaje.htmx.nima.jstache.DefaultTemplateProvider; } diff --git a/htmx-nima-jstache/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin b/htmx-nima-jstache/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin deleted file mode 100644 index 456aa71f..00000000 --- a/htmx-nima-jstache/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin +++ /dev/null @@ -1 +0,0 @@ -io.avaje.htmx.nima.jstache.DefaultTemplateProvider diff --git a/http-inject-plugin/pom.xml b/http-inject-plugin/pom.xml index d13cf829..a21ecbe9 100644 --- a/http-inject-plugin/pom.xml +++ b/http-inject-plugin/pom.xml @@ -26,10 +26,17 @@ io.avaje avaje-http-api - 1.37 + 2.7 true provided + + io.avaje + avaje-spi-service + 2.5 + provided + true + diff --git a/http-inject-plugin/src/main/java/io/avaje/http/inject/DefaultResolverProvider.java b/http-inject-plugin/src/main/java/io/avaje/http/inject/DefaultResolverProvider.java index 56b5ad2f..b22eb771 100644 --- a/http-inject-plugin/src/main/java/io/avaje/http/inject/DefaultResolverProvider.java +++ b/http-inject-plugin/src/main/java/io/avaje/http/inject/DefaultResolverProvider.java @@ -3,10 +3,12 @@ import io.avaje.http.api.context.RequestContextResolver; import io.avaje.http.api.context.ThreadLocalRequestContextResolver; import io.avaje.inject.BeanScopeBuilder; -import io.avaje.inject.spi.Plugin; +import io.avaje.inject.spi.InjectPlugin; +import io.avaje.spi.ServiceProvider; /** Plugin for avaje inject that provides a default RequestContextResolver instance. */ -public final class DefaultResolverProvider implements Plugin { +@ServiceProvider +public final class DefaultResolverProvider implements InjectPlugin { @Override public Class[] provides() { diff --git a/http-inject-plugin/src/main/java/module-info.java b/http-inject-plugin/src/main/java/module-info.java index c8149f2f..e13c5e73 100644 --- a/http-inject-plugin/src/main/java/module-info.java +++ b/http-inject-plugin/src/main/java/module-info.java @@ -1,8 +1,8 @@ module io.avaje.http.plugin { - requires io.avaje.http.api; - requires io.avaje.inject; - - provides io.avaje.inject.spi.Plugin with io.avaje.http.inject.DefaultResolverProvider; + requires io.avaje.http.api; + requires io.avaje.inject; + requires static io.avaje.spi; + provides io.avaje.inject.spi.InjectExtension with io.avaje.http.inject.DefaultResolverProvider; } diff --git a/http-inject-plugin/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin b/http-inject-plugin/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin deleted file mode 100644 index d996e4e0..00000000 --- a/http-inject-plugin/src/main/resources/META-INF/services/io.avaje.inject.spi.Plugin +++ /dev/null @@ -1 +0,0 @@ -io.avaje.http.inject.DefaultResolverProvider diff --git a/pom.xml b/pom.xml index 05a50c36..7a9ea774 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ jdk21plus - [21,22] + [21,) htmx-nima diff --git a/tests/pom.xml b/tests/pom.xml index e5b424de..cdec44f3 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -33,7 +33,7 @@ jdk21plus - [21,22] + [21,) test-nima From ff89af5f07eb01dffcba5fd392b2af82f56480a4 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Tue, 27 Aug 2024 01:46:42 -0400 Subject: [PATCH 52/54] Update Dependabot Grouping (#493) Now dependabot should create a single PR for all the dependencies. [Example PR](https://github.com/SentryMan/avaje-javalin-api-example/pull/50) --- .github/dependabot.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index de2383d8..8178f991 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,13 +3,16 @@ updates: - package-ecosystem: "maven" directory: "/" schedule: - interval: "weekly" + interval: weekly open-pull-requests-limit: 10 + groups: + dependencies: + patterns: + - "*" labels: - "dependencies" target-branch: "master" - - package-ecosystem: "github-actions" directory: "/" schedule: From da2b3f10b16b4de1907a5b0e907ad8fa8aa8ff73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 05:47:38 +0000 Subject: [PATCH 53/54] Bump io.avaje:avaje-spi-service in the dependencies group Bumps the dependencies group with 1 update: io.avaje:avaje-spi-service. Updates `io.avaje:avaje-spi-service` from 2.5 to 2.6 --- updated-dependencies: - dependency-name: io.avaje:avaje-spi-service dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies ... Signed-off-by: dependabot[bot] --- htmx-nima-jstache/pom.xml | 2 +- http-inject-plugin/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htmx-nima-jstache/pom.xml b/htmx-nima-jstache/pom.xml index 522c2139..fa0592dd 100644 --- a/htmx-nima-jstache/pom.xml +++ b/htmx-nima-jstache/pom.xml @@ -46,7 +46,7 @@ io.avaje avaje-spi-service - 2.5 + 2.6 provided true diff --git a/http-inject-plugin/pom.xml b/http-inject-plugin/pom.xml index a21ecbe9..91e9da05 100644 --- a/http-inject-plugin/pom.xml +++ b/http-inject-plugin/pom.xml @@ -33,7 +33,7 @@ io.avaje avaje-spi-service - 2.5 + 2.6 provided true From e2b71773ec16c51d0a89fb3de82c7dacb67d4d5e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 19:50:37 +0000 Subject: [PATCH 54/54] Bump the dependencies group with 3 updates Bumps the dependencies group with 3 updates: [org.avaje:java11-oss](https://github.com/avaje-pom/java11-oss), io.swagger.core.v3:swagger-annotations and io.swagger.core.v3:swagger-models. Updates `org.avaje:java11-oss` from 4.3 to 4.4 - [Release notes](https://github.com/avaje-pom/java11-oss/releases) - [Commits](https://github.com/avaje-pom/java11-oss/commits) Updates `io.swagger.core.v3:swagger-annotations` from 2.2.22 to 2.2.23 Updates `io.swagger.core.v3:swagger-models` from 2.2.22 to 2.2.23 Updates `io.swagger.core.v3:swagger-models` from 2.2.22 to 2.2.23 --- updated-dependencies: - dependency-name: org.avaje:java11-oss dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: io.swagger.core.v3:swagger-annotations dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: io.swagger.core.v3:swagger-models dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: io.swagger.core.v3:swagger-models dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies ... Signed-off-by: dependabot[bot] --- pom.xml | 4 ++-- tests/test-javalin-jsonb/pom.xml | 2 +- tests/test-javalin/pom.xml | 2 +- tests/test-jex/pom.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 7a9ea774..e569bebd 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.avaje java11-oss - 4.3 + 4.4 io.avaje @@ -19,7 +19,7 @@ true - 2.2.22 + 2.2.23 2.14.2 1.31 ${project.build.directory}${file.separator}module-info.shade diff --git a/tests/test-javalin-jsonb/pom.xml b/tests/test-javalin-jsonb/pom.xml index d130f7a8..d910cbb8 100644 --- a/tests/test-javalin-jsonb/pom.xml +++ b/tests/test-javalin-jsonb/pom.xml @@ -13,7 +13,7 @@ true org.example.myapp.Main - 2.2.22 + 2.2.23 1.3.71 diff --git a/tests/test-javalin/pom.xml b/tests/test-javalin/pom.xml index ee0919f2..925384ba 100644 --- a/tests/test-javalin/pom.xml +++ b/tests/test-javalin/pom.xml @@ -12,7 +12,7 @@ true org.example.myapp.Main - 2.2.22 + 2.2.23 1.3.71 diff --git a/tests/test-jex/pom.xml b/tests/test-jex/pom.xml index 7625ec2e..dc6834c5 100644 --- a/tests/test-jex/pom.xml +++ b/tests/test-jex/pom.xml @@ -13,7 +13,7 @@ true org.example.myapp.Main 2.5 - 2.2.22 + 2.2.23