Skip to content

Commit

Permalink
Fix refs automatically set to nullable (#1397)
Browse files Browse the repository at this point in the history
Fixes the issue mentioned on #1391 (comment)
  • Loading branch information
momala454 authored Jan 31, 2023
1 parent 6f190e1 commit 420e6ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Processors/AugmentProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected function augmentType(Analysis $analysis, OA\Property $property, Contex
}

// ok, so we possibly have a type or ref
if (!Generator::isDefault($property->ref) && $typeMatches[2] === '' && $property->nullable) {
if (!Generator::isDefault($property->ref) && $typeMatches[2] === '' && !Generator::isDefault($property->nullable) && $property->nullable) {
$refKey = $this->toRefKey($context, $type);
$property->oneOf = [
$schema = new OA\Schema([
Expand Down

0 comments on commit 420e6ad

Please sign in to comment.