Skip to content

Commit

Permalink
use JsonAnySetter for pattern properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Nov 20, 2024
1 parent f1bb8c8 commit 28e2279
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class JavaModelClassFileProducer constructor(override val vrapTypeProvider: Vrap
|
|import com.fasterxml.jackson.core.JsonProcessingException;
|import com.fasterxml.jackson.databind.annotation.*;
|import com.fasterxml.jackson.annotation.JsonAnySetter;
|import com.fasterxml.jackson.annotation.JsonCreator;
|import com.fasterxml.jackson.annotation.JsonIgnore;
|import com.fasterxml.jackson.annotation.JsonInclude;
Expand Down Expand Up @@ -282,7 +283,7 @@ class JavaModelClassFileProducer constructor(override val vrapTypeProvider: Vrap
.filterNot { it.name == this.discriminator() && this.discriminatorValue != null}
.map {
if(it.isPatternProperty()) {
"final Map<String, ${it.type.toVrapType().fullClassName()}> values"
"@JsonAnySetter() final Map<String, ${it.type.toVrapType().fullClassName()}> values"
}else if(it.name.equals("interface")) {
"@JsonProperty(\"${it.name.lowerCamelCase()}\") final ${it.type.toVrapType().fullClassName()} _interface"
} else {
Expand Down

0 comments on commit 28e2279

Please sign in to comment.