Package org.springdoc.core.customizers
Class JavaNullablePropertyCustomizer
java.lang.Object
org.springdoc.core.customizers.AbstractNullablePropertyCustomizer
org.springdoc.core.customizers.JavaNullablePropertyCustomizer
- All Implemented Interfaces:
io.swagger.v3.core.converter.ModelConverter
Marks schema properties as nullable for Java class properties that are explicitly
annotated with a
@Nullable annotation (e.g. JSpecify, Spring, JSR-305), either on
the field, its getter / record accessor, or its constructor parameter. Both declaration
and type-use annotations are supported.- Author:
- Mattias-Sehlstedt
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJavaNullablePropertyCustomizer(ObjectMapperProvider objectMapperProvider) Instantiates a new Java nullable property customizer. -
Method Summary
Modifier and TypeMethodDescriptionfindNullableProperties(com.fasterxml.jackson.databind.JavaType javaType) Finds the serialized names of the properties explicitly annotated as nullable.Methods inherited from class org.springdoc.core.customizers.AbstractNullablePropertyCustomizer
getObjectMapperProvider, resolveMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.swagger.v3.core.converter.ModelConverter
isOpenapi31
-
Constructor Details
-
JavaNullablePropertyCustomizer
Instantiates a new Java nullable property customizer.- Parameters:
objectMapperProvider- the object mapper provider
-
-
Method Details
-
findNullableProperties
Finds the serialized names of the properties explicitly annotated as nullable.- Specified by:
findNullablePropertiesin classAbstractNullablePropertyCustomizer- Parameters:
javaType- the java type- Returns:
- the set of nullable property names
-