Loading src/main/java/com/kjetland/jackson/jsonSchema/annotations/JsonSchemaNotNull.java 0 → 100755 +12 −0 Original line number Diff line number Diff line package com.kjetland.jackson.jsonSchema.annotations; import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.*; import static java.lang.annotation.RetentionPolicy.RUNTIME; @Target({ METHOD, FIELD, PARAMETER, TYPE }) @Retention(RUNTIME) public @interface JsonSchemaNotNull { } src/main/scala/com/kjetland/jackson/jsonSchema/JsonSchemaGenerator.scala +7 −3 Original line number Diff line number Diff line Loading @@ -704,7 +704,7 @@ class JsonSchemaGenerator val objectBuilder: ObjectNode => Option[JsonObjectFormatVisitor] = { thisObjectNode: ObjectNode => //thisObjectNode.put("type", "object") //thisObjectNode.put("additionalProperties", false) // If class is annotated with JsonSchemaFormat, we should add it Loading @@ -714,6 +714,12 @@ class JsonSchemaGenerator setFormat(thisObjectNode, format) } if (ac.getAnnotation(classOf[JsonSchemaNotNull]) != null) { thisObjectNode.put("type", "object") } else { setType(thisObjectNode, null, "object") } // If class is annotated with JsonSchemaDescription, we should add it Option(ac.getAnnotations.get(classOf[JsonSchemaDescription])).map(_.value()) .orElse(Option(ac.getAnnotations.get(classOf[JsonPropertyDescription])).map(_.value)) Loading Loading @@ -769,8 +775,6 @@ class JsonSchemaGenerator if (propertyIsNotIgnored(prop)) { setType(thisObjectNode, prop, "object"); l(s"JsonObjectFormatVisitor - ${propertyName}: ${propertyType}") if (propertiesNode.get(propertyName) != null) { if (!config.disableWarnings) { Loading Loading
src/main/java/com/kjetland/jackson/jsonSchema/annotations/JsonSchemaNotNull.java 0 → 100755 +12 −0 Original line number Diff line number Diff line package com.kjetland.jackson.jsonSchema.annotations; import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.*; import static java.lang.annotation.RetentionPolicy.RUNTIME; @Target({ METHOD, FIELD, PARAMETER, TYPE }) @Retention(RUNTIME) public @interface JsonSchemaNotNull { }
src/main/scala/com/kjetland/jackson/jsonSchema/JsonSchemaGenerator.scala +7 −3 Original line number Diff line number Diff line Loading @@ -704,7 +704,7 @@ class JsonSchemaGenerator val objectBuilder: ObjectNode => Option[JsonObjectFormatVisitor] = { thisObjectNode: ObjectNode => //thisObjectNode.put("type", "object") //thisObjectNode.put("additionalProperties", false) // If class is annotated with JsonSchemaFormat, we should add it Loading @@ -714,6 +714,12 @@ class JsonSchemaGenerator setFormat(thisObjectNode, format) } if (ac.getAnnotation(classOf[JsonSchemaNotNull]) != null) { thisObjectNode.put("type", "object") } else { setType(thisObjectNode, null, "object") } // If class is annotated with JsonSchemaDescription, we should add it Option(ac.getAnnotations.get(classOf[JsonSchemaDescription])).map(_.value()) .orElse(Option(ac.getAnnotations.get(classOf[JsonPropertyDescription])).map(_.value)) Loading Loading @@ -769,8 +775,6 @@ class JsonSchemaGenerator if (propertyIsNotIgnored(prop)) { setType(thisObjectNode, prop, "object"); l(s"JsonObjectFormatVisitor - ${propertyName}: ${propertyType}") if (propertiesNode.get(propertyName) != null) { if (!config.disableWarnings) { Loading