Skip to content

Commit

Permalink
[fix] empty default value bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Dubinsky committed Jan 13, 2022
1 parent 78e7c18 commit 33cd268
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Add this to you pom.xml:
<dependency>
<groupId>net.almson</groupId>
<artifactId>mbknor-jackson-jsonschema-java</artifactId>
<version>1.0.39</version>
<version>1.0.39.1</version>
</dependency>


Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.almson</groupId>
<artifactId>mbknor-jackson-jsonschema-java</artifactId>
<version>1.0.39</version>
<version>1.0.39.1</version>
<packaging>jar</packaging>

<description>mbknor-jackson-jsonSchema</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ String extractDefaultValue() {

// Plain java
var jp = tryGetAnnotation(JsonProperty.class);
if (jp != null)
if (jp != null
&& jp.defaultValue() != null
&& !jp.defaultValue().isEmpty()) // unfortunately, defaultValue is empty by default
return jp.defaultValue();

var jsd = tryGetAnnotation(JsonSchemaDefault.class);
Expand Down

0 comments on commit 33cd268

Please sign in to comment.