diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverter.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverter.java index e8083e57a..f51b7b120 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverter.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/json/PersistentEntityToJsonSchemaConverter.java @@ -166,8 +166,6 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric JsonSchemaPropertyRegistrar registrar = new JsonSchemaPropertyRegistrar(jackson); - // final List> properties = new ArrayList>(); - for (BeanPropertyDefinition definition : jackson) { PersistentProperty persistentProperty = entity.getPersistentProperty(definition.getInternalName()); @@ -182,6 +180,10 @@ public class PersistentEntityToJsonSchemaConverter implements ConditionalGeneric if (persistentProperty.isVersionProperty()) { continue; } + + if (!definition.couldSerialize()) { + continue; + } } TypeInformation propertyType = persistentProperty == null