*/
@Override
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
final PersistentEntity<?, ?> persistentEntity = repositories.getPersistentEntity((Class<?>) source);
final ResourceMetadata metadata = mappings.getMappingFor(persistentEntity.getType());
final JsonSchema jsonSchema = new JsonSchema(persistentEntity.getName(),
resolveMessage(metadata.getItemResourceDescription()));
persistentEntity.doWithProperties(new SimplePropertyHandler() {
/*
* (non-Javadoc)
* @see org.springframework.data.mapping.PropertyHandler#doWithPersistentProperty(org.springframework.data.mapping.PersistentProperty)
*/
@Override
public void doWithPersistentProperty(PersistentProperty<?> persistentProperty) {
Class<?> propertyType = persistentProperty.getType();
String type = uncapitalize(propertyType.getSimpleName());
ResourceMapping propertyMapping = metadata.getMappingFor(persistentProperty);
ResourceDescription description = propertyMapping.getDescription();
String message = resolveMessage(description);
Property property = persistentProperty.isCollectionLike() ? //
new ArrayProperty("array", message, false)