Skip to content

Commit 7c198c8

Browse files
committed
feat(OpenApiType): Warn about non-required nullable properties
Signed-off-by: provokateurin <[email protected]>
1 parent 63bbc54 commit 7c198c8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/OpenApiType.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ public static function resolve(string $context, array $definitions, ParamTagValu
210210
$properties[$name] = $type;
211211
if (!$item->optional) {
212212
$required[] = $name;
213+
} elseif ($type->nullable) {
214+
Logger::warning($context, 'Property "' . $name . '" is both nullable and not required. Please consider only using one of these at once.');
213215
}
214216
}
215217
return new OpenApiType(

0 commit comments

Comments
 (0)