src/Swagger/Serializer/DocumentationNormalizer.php
private function getDefinitionSchema(bool $v3, string $resourceClass, ResourceMetadata $resourceMetadata, \ArrayObject $definitions, array $serializerContext = null): \ArrayObject
    {
        $definitionSchema = new \ArrayObject(['type' => 'object']);

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

        if (null !== $iri = $resourceMetadata->getIri()) {
            $definitionSchema['externalDocs'] = ['url' => $iri];
        }

        $options = isset($serializerContext[AbstractNormalizer::GROUPS]) ? ['serializer_groups' => $serializerContext[AbstractNormalizer::GROUPS]] : [];
        foreach ($this->propertyNameCollectionFactory->create($resourceClass, $options) as $propertyName) {
            $propertyMetadata = $this->propertyMetadataFactory->create($resourceClass, $propertyName);
            $normalizedPropertyName = $this->nameConverter ? $this->nameConverter->normalize($propertyName, $resourceClass, self::FORMAT, $serializerContext ?? []) : $propertyName;
            if ($propertyMetadata->isRequired()) {
                $definitionSchema['required'][] = $normalizedPropertyName;
            }

            $definitionSchema['properties'][$normalizedPropertyName] = $this->getPropertySchema($v3, $propertyMetadata, $definitions, $serializerContext);
        }

        return $definitionSchema;
    }
private function getDefinitionSchema(bool $v3, string $resourceClass, ResourceMetadata $resourceMetadata, \ArrayObject $definitions, array $serializerContext = null): \ArrayObject
    {
        $definitionSchema = new \ArrayObject(['type' => 'object']);

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

        if (null !== $iri = $resourceMetadata->getIri()) {
            $definitionSchema['externalDocs'] = ['url' => $iri];
        }

        $options = isset($serializerContext[AbstractNormalizer::GROUPS]) ? ['serializer_groups' => $serializerContext[AbstractNormalizer::GROUPS]] : [];
        foreach ($this->propertyNameCollectionFactory->create($resourceClass, $options) as $propertyName) {
            $propertyMetadata = $this->propertyMetadataFactory->create($resourceClass, $propertyName);
            $normalizedPropertyName = $this->nameConverter ? $this->nameConverter->normalize($propertyName, $resourceClass, self::FORMAT, $serializerContext ?? []) : $propertyName;
            if ($propertyMetadata->isRequired()) {
                $definitionSchema['required'][] = $normalizedPropertyName;
            }

            $definitionSchema['properties'][$normalizedPropertyName] = $this->getPropertySchema($v3, $propertyMetadata, $definitions, $serializerContext);
        }

        return $definitionSchema;
    }
private function getDefinitionSchema ( bool $ v3 , string $ resourceClass , ResourceMetadata $ resourceMetadata , \ ArrayObject $ definitions , array $ serializerContext = null ) : \ ArrayObject { $ definitionSchema = new \ ArrayObject ( [ 'type' => 'object' ] ) ; if ( null !== $ description = $ resourceMetadata -> getDescription ( ) ) { $ definitionSchema [ 'description' ] = $ description ; } if ( null !== $ iri = $ resourceMetadata -> getIri ( ) ) { $ definitionSchema [ 'externalDocs' ] = [ 'url' => $ iri ] ; } $ options = isset ( $ serializerContext [ AbstractNormalizer :: GROUPS ] ) ? [ 'serializer_groups' => $ serializerContext [ AbstractNormalizer :: GROUPS ] ] : [ ] ; foreach ( $ this -> propertyNameCollectionFactory -> create ( $ resourceClass , $ options ) as $ propertyName ) { $ propertyMetadata = $ this -> propertyMetadataFactory -> create ( $ resourceClass , $ propertyName ) ; $ normalizedPropertyName = $ this -> nameConverter ? $ this -> nameConverter -> normalize ( $ propertyName , $ resourceClass , self :: FORMAT , $ serializerContext ?? [ ] ) : $ propertyName ; if ( $ propertyMetadata -> isRequired ( ) ) { $ definitionSchema [ 'required' ] [ ] = $ normalizedPropertyName ; } $ definitionSchema [ 'properties' ] [ $ normalizedPropertyName ] = $ this -> getPropertySchema ( $ v3 , $ propertyMetadata , $ definitions , $ serializerContext ) ; } return $ definitionSchema ; }
Gets a definition Schema Object.

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