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 9c9814d9 ensure JsonbProperty is imported when enums use it
9c9814d9 is described below

commit 9c9814d94984ee1f525c6aa2d291329cf4f0ece4
Author: Romain Manni-Bucau <rmannibu...@gmail.com>
AuthorDate: Wed Aug 10 14:42:58 2022 +0200

    ensure JsonbProperty is imported when enums use it
---
 .../java/org/apache/johnzon/jsonschema/generator/PojoGenerator.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/johnzon-jsonschema/src/main/java/org/apache/johnzon/jsonschema/generator/PojoGenerator.java
 
b/johnzon-jsonschema/src/main/java/org/apache/johnzon/jsonschema/generator/PojoGenerator.java
index 0f0ba037..e6cb4ab4 100644
--- 
a/johnzon-jsonschema/src/main/java/org/apache/johnzon/jsonschema/generator/PojoGenerator.java
+++ 
b/johnzon-jsonschema/src/main/java/org/apache/johnzon/jsonschema/generator/PojoGenerator.java
@@ -212,7 +212,7 @@ public class PojoGenerator {
     }
 
     /**
-     * @param values the enum values (key is json name, value is java name).
+     * @param values            the enum values (key is json name, value is 
java name).
      * @param valuesAreInjected is there a toString() with json name or is the 
enum anemic (only values, no method)
      * @return the data to add after enum name and before the opening brace in 
enum declaration.
      */
@@ -343,6 +343,7 @@ public class PojoGenerator {
                         "package " + configuration.getPackageName() + ";\n" +
                         "\n" +
                         enumImports() +
+                        (injectValues ? "import " + 
JsonbProperty.class.getName() + ";\n\n" : "") +
                         beforeEnumDeclaration() +
                         "public enum " + className + afterEnumName(values, 
injectValues) + " {\n" +
                         values.entrySet().stream()

Reply via email to