Skip to content

Commit 37ad293

Browse files
committed
in swagger mark property as readOnly when is not writable and initializable
1 parent e1733fd commit 37ad293

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Swagger/Serializer/DocumentationNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ private function getPropertySchema(PropertyMetadata $propertyMetadata, \ArrayObj
445445
{
446446
$propertySchema = new \ArrayObject($propertyMetadata->getAttributes()['swagger_context'] ?? []);
447447

448-
if (false === $propertyMetadata->isWritable()) {
448+
if (false === $propertyMetadata->isWritable() && !$propertyMetadata->isInitializable()) {
449449
$propertySchema['readOnly'] = true;
450450
}
451451

0 commit comments

Comments
 (0)