Skip to content

Commit

Permalink
Integrate @JsonView and correct no-view behaviour (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstepanov authored Nov 15, 2023
1 parent c505bd6 commit d2ad56e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 123 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package io.micronaut.serde.jackson.annotation

import io.micronaut.serde.jackson.JsonViewSpec

class SerdeJsonViewSpec extends JsonViewSpec {
}
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@ public Serializer.EncoderContext newEncoderContext(Class<?> view) {
return new DefaultEncoderContext(this) {
@Override
public boolean hasView(Class<?>... views) {
if (view == null || view == Object.class) {
return true;
}
for (Class<?> candidate : views) {
if (candidate.isAssignableFrom(view)) {
return true;
Expand All @@ -471,6 +474,9 @@ public Deserializer.DecoderContext newDecoderContext(Class<?> view) {
return new DefaultDecoderContext(this) {
@Override
public boolean hasView(Class<?>... views) {
if (view == null || view == Object.class) {
return true;
}
for (Class<?> candidate : views) {
if (candidate.isAssignableFrom(view)) {
return true;
Expand Down

0 comments on commit d2ad56e

Please sign in to comment.