Skip to content

Commit

Permalink
Merge pull request #194 from nextcloud/feat/openapitype/warn-non-requ…
Browse files Browse the repository at this point in the history
…ired-nullable-properties

feat(OpenApiType): Warn about non-required nullable properties
  • Loading branch information
provokateurin authored Dec 17, 2024
2 parents 2bf65ca + 7c198c8 commit 40302d1
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 40302d1

Please sign in to comment.