This is an automated email from the ASF dual-hosted git repository. rmannibucau pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/johnzon.git
The following commit(s) were added to refs/heads/master by this push: new b221d9d [JOHNZON-354] reverse johnzon.failOnMissingCreatorValues default and support jsonb.creator-parameters-required prop b221d9d is described below commit b221d9db923c142afcddde056abd9301acbf9af1 Author: Romain Manni-Bucau <rmannibu...@gmail.com> AuthorDate: Tue Nov 23 11:19:11 2021 +0100 [JOHNZON-354] reverse johnzon.failOnMissingCreatorValues default and support jsonb.creator-parameters-required prop --- johnzon-core/pom.xml | 1 - johnzon-json-extras/pom.xml | 1 - johnzon-jsonb/pom.xml | 2 +- .../src/main/java/org/apache/johnzon/jsonb/JohnzonBuilder.java | 5 ++++- .../java/org/apache/johnzon/jsonb/DynamicBufferResizingTest.java | 2 +- johnzon-jsonlogic/pom.xml | 2 +- johnzon-jsonp-strict/pom.xml | 2 +- johnzon-mapper/pom.xml | 1 - johnzon-osgi/pom.xml | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/johnzon-core/pom.xml b/johnzon-core/pom.xml index 6b9b407..9bcd1cd 100644 --- a/johnzon-core/pom.xml +++ b/johnzon-core/pom.xml @@ -27,7 +27,6 @@ <artifactId>johnzon-core</artifactId> <name>Johnzon :: Core</name> - <packaging>bundle</packaging> <properties> <staging.directory>${project.parent.reporting.outputDirectory}</staging.directory> diff --git a/johnzon-json-extras/pom.xml b/johnzon-json-extras/pom.xml index 4c88d86..d460f04 100644 --- a/johnzon-json-extras/pom.xml +++ b/johnzon-json-extras/pom.xml @@ -27,7 +27,6 @@ <artifactId>johnzon-jsonb-extras</artifactId> <name>Johnzon :: JSON-B Extensions</name> - <packaging>bundle</packaging> <properties> <staging.directory>${project.parent.reporting.outputDirectory}</staging.directory> diff --git a/johnzon-jsonb/pom.xml b/johnzon-jsonb/pom.xml index 5c6ff3c..dcbd370 100644 --- a/johnzon-jsonb/pom.xml +++ b/johnzon-jsonb/pom.xml @@ -27,7 +27,7 @@ <artifactId>johnzon-jsonb</artifactId> <name>Johnzon :: JSON-B Implementation</name> - <packaging>bundle</packaging> + <properties> <staging.directory>${project.parent.reporting.outputDirectory}</staging.directory> diff --git a/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JohnzonBuilder.java b/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JohnzonBuilder.java index d21bb18..24966cc 100644 --- a/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JohnzonBuilder.java +++ b/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JohnzonBuilder.java @@ -222,9 +222,12 @@ public class JohnzonBuilder implements JsonbBuilder { config.getProperty("johnzon.accessModeDelegate") .map(this::toAccessMode) .orElseGet(() -> new FieldAndMethodAccessMode(true, true, false, true)), + // this changes in v3 of the spec so let's use this behavior which makes everyone happy by default config.getProperty("johnzon.failOnMissingCreatorValues") .map(this::toBool) - .orElse(true) /*spec 1.0 requirement*/, + .orElseGet(() -> config.getProperty("jsonb.creator-parameters-required") + .map(this::toBool) + .orElse(false)), isNillable, config.getProperty("johnzon.supportsPrivateAccess") .map(this::toBool) diff --git a/johnzon-jsonb/src/test/java/org/apache/johnzon/jsonb/DynamicBufferResizingTest.java b/johnzon-jsonb/src/test/java/org/apache/johnzon/jsonb/DynamicBufferResizingTest.java index 6e4d378..22c6e78 100644 --- a/johnzon-jsonb/src/test/java/org/apache/johnzon/jsonb/DynamicBufferResizingTest.java +++ b/johnzon-jsonb/src/test/java/org/apache/johnzon/jsonb/DynamicBufferResizingTest.java @@ -56,7 +56,7 @@ public class DynamicBufferResizingTest { @Test(expected = JsonbException.class) public void failOnMissingProp() throws Exception { - try (final Jsonb jsonb = JsonbBuilder.create()) { + try (final Jsonb jsonb = JsonbBuilder.create(new JsonbConfig().setProperty("jsonb.creator-parameters-required", true))) { jsonb.fromJson(jsonb.toJson(new Request("Screenshot.png", null, null)), Request.class); } } diff --git a/johnzon-jsonlogic/pom.xml b/johnzon-jsonlogic/pom.xml index b51aa4b..cb0c3fe 100644 --- a/johnzon-jsonlogic/pom.xml +++ b/johnzon-jsonlogic/pom.xml @@ -27,7 +27,7 @@ <artifactId>johnzon-jsonlogic</artifactId> <name>Johnzon :: JSON Logic</name> - <packaging>bundle</packaging> + <dependencies> <dependency> diff --git a/johnzon-jsonp-strict/pom.xml b/johnzon-jsonp-strict/pom.xml index 9981a61..12d0a10 100644 --- a/johnzon-jsonp-strict/pom.xml +++ b/johnzon-jsonp-strict/pom.xml @@ -27,7 +27,7 @@ <artifactId>johnzon-jsonp-strict</artifactId> <name>Johnzon :: JSON-P Strict JSON Pointer Implementation (spec compliant)</name> - <packaging>bundle</packaging> + <properties> <staging.directory>${project.parent.reporting.outputDirectory}</staging.directory> diff --git a/johnzon-mapper/pom.xml b/johnzon-mapper/pom.xml index 8a477ec..d6d4e49 100644 --- a/johnzon-mapper/pom.xml +++ b/johnzon-mapper/pom.xml @@ -70,7 +70,6 @@ <properties> <staging.directory>${project.parent.reporting.outputDirectory}</staging.directory> </properties> - <packaging>bundle</packaging> <build> <plugins> diff --git a/johnzon-osgi/pom.xml b/johnzon-osgi/pom.xml index f9ed9f8..68420bf 100644 --- a/johnzon-osgi/pom.xml +++ b/johnzon-osgi/pom.xml @@ -27,7 +27,7 @@ <artifactId>johnzon-osgi</artifactId> <name>Johnzon :: Support for OSGI Jaxrs Whiteboard</name> - <packaging>bundle</packaging> + <dependencies> <dependency> @@ -128,4 +128,4 @@ </plugin> </plugins> </build> -</project> \ No newline at end of file +</project>