Skip to content

Commit

Permalink
feat(OpenApiType): Warn about non-required nullable properties
Browse files Browse the repository at this point in the history
Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Dec 17, 2024
1 parent 63bbc54 commit 7c198c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/OpenApiType.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ public static function resolve(string $context, array $definitions, ParamTagValu
$properties[$name] = $type;
if (!$item->optional) {
$required[] = $name;
} elseif ($type->nullable) {
Logger::warning($context, 'Property "' . $name . '" is both nullable and not required. Please consider only using one of these at once.');
}
}
return new OpenApiType(
Expand Down

0 comments on commit 7c198c8

Please sign in to comment.