Add support for nullable schema field
what
Schemas can have an annotation stating that they are nullable.
This fix uses a possibly set nullable field for the resulting OpenAPI
description.
@@ -618,6 +618,10 @@ public class OpenAPIParser {
Optional.ofNullable(schemaMap.get("not")).ifPresent(not -> schema.not(not.get(0)));
+ Optional.ofNullable(annotation.get("nullable"))
+ .filter(nullable -> nullable instanceof Boolean)
+ .ifPresent(nullable -> schema.setNullable((Boolean)nullable));
+
annotationValue(annotation, "externalDocs",
value -> externalDocumentation(value, schema::setExternalDocs));
