Skip to content

Commit aa390be

Browse files
committed
Remove default value in Model definition
1 parent 44ab921 commit aa390be

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Definitions/DefinitionGenerator.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,7 @@ public function generateSchemas(): array
119119
$swaggerProps['description'] = "$description";
120120
}
121121

122-
if (isset($column['default']) && $column['default']) {
123-
$swaggerProps['default'] = $column['default'];
124-
} else {
125-
$this->addExampleKey($column);
126-
}
122+
$this->addExampleKey($column);
127123

128124
if (!$column['nullable']) {
129125
$required[] = $column['name'];
@@ -453,4 +449,12 @@ private function convertPhpTypeToSwaggerType(string $phpType): array
453449
'nullable' => true,
454450
];
455451
}
452+
453+
private function removeQuotesIfBothEnds(string $string)
454+
{
455+
if (strlen($string) >= 2 && $string[0] === "'" && $string[strlen($string) - 1] === "'") {
456+
return substr($string, 1, -1);
457+
}
458+
return $string;
459+
}
456460
}

0 commit comments

Comments
 (0)