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 58fd2082 [JOHNZON-387] fixing ref name in jsonschema
58fd2082 is described below

commit 58fd208253d555e67bb2a867153a5aa9c12ca132
Author: Romain Manni-Bucau <rmannibu...@gmail.com>
AuthorDate: Mon Aug 8 14:46:03 2022 +0200

    [JOHNZON-387] fixing ref name in jsonschema
---
 .../java/org/apache/johnzon/jsonschema/generator/PojoGenerator.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 1cb7193c..d7b161ad 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
@@ -203,7 +203,7 @@ public class PojoGenerator {
     }
 
     protected String asType(final String javaName, final JsonObject schema, 
final boolean required) {
-        final JsonValue ref = schema.get("ref");
+        final JsonValue ref = schema.get("$ref");
         if (ref != null && ref.getValueType() == JsonValue.ValueType.STRING) {
             final String name = onRef(JsonString.class.cast(ref).getString());
             if (name != null) {
@@ -426,7 +426,7 @@ public class PojoGenerator {
     }
 
     protected String onItemSchema(final String javaName, final JsonObject 
schema) {
-        final JsonValue ref = schema.get("ref");
+        final JsonValue ref = schema.get("$ref");
         if (ref != null && ref.getValueType() == JsonValue.ValueType.STRING) {
             final String name = onRef(JsonString.class.cast(ref).getString());
             if (name != null) {

Reply via email to