for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace ApiPlatform\Core\OpenApi;
use ApiPlatform\Core\JsonSchema\Schema as JsonSchema;
class Schema
{
private $nullable;
private $discriminator;
private $readOnly;
private $writeOnly;
private $xml;
private $externalDocs;
private $example;
private $deprecated;
public function __construct(?bool $nullable = false, $discriminator = null, bool $readOnly = false, bool $writeOnly = false, string $xml = null, $externalDocs = null, $example = null, bool $deprecated = false)
$this->nullable = $nullable;
$this->discriminator = $discriminator;
$this->readOnly = $readOnly;
$this->writeOnly = $writeOnly;
$this->xml = $xml;
$this->externalDocs = $externalDocs;
$this->example = $example;
$this->deprecated = $deprecated;
$this->schema = new JsonSchema();
schema
}
public function setDefinitions(array $definitions)
$this->schema->setDefinitions(new \ArrayObject($definitions));
public function getDefinitions(): \ArrayObject
return new \ArrayObject(array_merge((array) $this->schema->getDefinitions(), (array) $this));