src/Swagger/Serializer/DocumentationNormalizer.php
private function getPropertySchema(bool $v3, PropertyMetadata $propertyMetadata, \ArrayObject $definitions, array $serializerContext = null): \ArrayObject
    {
        $propertySchema = new \ArrayObject($propertyMetadata->getAttributes()[$v3 ? 'openapi_context' : 'swagger_context'] ?? []);

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

        if (null !== $description = $propertyMetadata->getDescription()) {
            $propertySchema['description'] = $description;
        }

        if (null === $type = $propertyMetadata->getType()) {
            return $propertySchema;
        }

        $isCollection = $type->isCollection();
        if (null === $valueType = $isCollection ? $type->getCollectionValueType() : $type) {
            $builtinType = 'string';
            $className = null;
        } else {
            $builtinType = $valueType->getBuiltinType();
            $className = $valueType->getClassName();
        }

        $valueSchema = $this->getType($v3, $builtinType, $isCollection, $className, $propertyMetadata->isReadableLink(), $definitions, $serializerContext);

        return new \ArrayObject((array) $propertySchema + $valueSchema);
    }
private function getPropertySchema(bool $v3, PropertyMetadata $propertyMetadata, \ArrayObject $definitions, array $serializerContext = null): \ArrayObject
    {
        $propertySchema = new \ArrayObject($propertyMetadata->getAttributes()[$v3 ? 'openapi_context' : 'swagger_context'] ?? []);

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

        if (null !== $description = $propertyMetadata->getDescription()) {
            $propertySchema['description'] = $description;
        }

        if (null === $type = $propertyMetadata->getType()) {
            return $propertySchema;
        }

        $isCollection = $type->isCollection();
        if (null === $valueType = $isCollection ? $type->getCollectionValueType() : $type) {
            $builtinType = 'string';
            $className = null;
        } else {
            $builtinType = $valueType->getBuiltinType();
            $className = $valueType->getClassName();
        }

        $valueSchema = $this->getType($v3, $builtinType, $isCollection, $className, $propertyMetadata->isReadableLink(), $definitions, $serializerContext);

        return new \ArrayObject((array) $propertySchema + $valueSchema);
    }
private function getPropertySchema ( bool $ v3 , PropertyMetadata $ propertyMetadata , \ ArrayObject $ definitions , array $ serializerContext = null ) : \ ArrayObject { $ propertySchema = new \ ArrayObject ( $ propertyMetadata -> getAttributes ( ) [ $ v3 ? 'openapi_context' : 'swagger_context' ] ?? [ ] ) ; if ( false === $ propertyMetadata -> isWritable ( ) && ! $ propertyMetadata -> isInitializable ( ) ) { $ propertySchema [ 'readOnly' ] = true ; } if ( null !== $ description = $ propertyMetadata -> getDescription ( ) ) { $ propertySchema [ 'description' ] = $ description ; } if ( null === $ type = $ propertyMetadata -> getType ( ) ) { return $ propertySchema ; } $ isCollection = $ type -> isCollection ( ) ; if ( null === $ valueType = $ isCollection ? $ type -> getCollectionValueType ( ) : $ type ) { $ builtinType = 'string' ; $ className = null ; } else { $ builtinType = $ valueType -> getBuiltinType ( ) ; $ className = $ valueType -> getClassName ( ) ; } $ valueSchema = $ this -> getType ( $ v3 , $ builtinType , $ isCollection , $ className , $ propertyMetadata -> isReadableLink ( ) , $ definitions , $ serializerContext ) ; return new \ ArrayObject ( ( array ) $ propertySchema + $ valueSchema ) ; }
Gets a property Schema Object.

@see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#schemaObject
Gets a property Schema Object .