-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport fixes from 4.0.x and fix ConvertibleValuesDeserializer (#8489)
* Don't include write only properties in serialization (#8457) Co-authored-by: yawkat <jonas.konrad@oracle.com>
- Loading branch information
1 parent
aa22661
commit 1e98d85
Showing
9 changed files
with
258 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
jackson-databind/src/test/groovy/io/micronaut/jackson/modules/testclasses/HTTPCheck.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package io.micronaut.jackson.modules.testclasses; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.PropertyNamingStrategies; | ||
import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
import io.micronaut.core.annotation.Introspected; | ||
import io.micronaut.core.convert.value.ConvertibleMultiValues; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
@JsonNaming(PropertyNamingStrategies.UpperCamelCaseStrategy.class) | ||
@Introspected | ||
public class HTTPCheck { | ||
private ConvertibleMultiValues<String> headers = ConvertibleMultiValues.empty(); | ||
|
||
public ConvertibleMultiValues<String> getHeader() { | ||
return headers; | ||
} | ||
|
||
/** | ||
* @param headers The headers | ||
*/ | ||
@JsonProperty("Header") | ||
public void setHeaders(Map<CharSequence, List<String>> headers) { | ||
if (headers == null) { | ||
this.headers = ConvertibleMultiValues.empty(); | ||
} else { | ||
this.headers = ConvertibleMultiValues.of(headers); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
HTTPCheck httpCheck = (HTTPCheck) o; | ||
return headers.equals(httpCheck.headers); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(headers); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
jackson-databind/src/test/groovy/io/micronaut/jackson/modules/testclasses/InstanceInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package io.micronaut.jackson.modules.testclasses; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonRootName; | ||
import io.micronaut.core.annotation.Introspected; | ||
|
||
import java.util.Objects; | ||
|
||
@JsonRootName("instance") | ||
@Introspected | ||
public class InstanceInfo { | ||
private final String hostName; | ||
|
||
@JsonCreator | ||
InstanceInfo( | ||
@JsonProperty("hostName") String hostName) { | ||
this.hostName = hostName; | ||
} | ||
|
||
public String getHostName() { | ||
return hostName; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
InstanceInfo that = (InstanceInfo) o; | ||
return hostName.equals(that.hostName); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(hostName); | ||
} | ||
} |