Search in sources :

Example 1 with JsonClassDescription

use of com.fasterxml.jackson.annotation.JsonClassDescription in project jsonschema-generator by victools.

the class JacksonModule method resolveDescriptionForType.

/**
 * Determine the given type's associated "description" via the following annotation.
 * <ul>
 * <li>{@link JsonClassDescription} annotation on the targeted type's class</li>
 * </ul>
 *
 * @param scope scope for which to collect an available description
 * @return successfully looked-up description (or {@code null})
 */
protected String resolveDescriptionForType(TypeScope scope) {
    Class<?> rawType = scope.getType().getErasedType();
    JsonClassDescription classAnnotation = rawType.getAnnotation(JsonClassDescription.class);
    if (classAnnotation != null) {
        return classAnnotation.value();
    }
    return null;
}
Also used : JsonClassDescription(com.fasterxml.jackson.annotation.JsonClassDescription)

Aggregations

JsonClassDescription (com.fasterxml.jackson.annotation.JsonClassDescription)1