<?php declare(strict_types=1);

/**
 * @license Apache 2.0
 */

namespace OpenApi\Annotations;

use OpenApi\Generator;

/**
 * Shorthand for a json response.
 *
 * Use as `@OA\Schema` inside a `Response` and `MediaType`->`'application/json'` will be generated.
 *
 * @Annotation
 */
class JsonContent extends Schema
{
    /**
     * An associative array of Examples attributes.
     *
     * The keys represent the name of the example and the values are instances of the Examples attribute.
     * Each example is used to show how the content of the request or response should look like.
     *
     * @var array<string,Examples>
     */
    public $examples = Generator::UNDEFINED;

    /**
     * @inheritdoc
     */
    public static $_parents = [];

    /**
     * @inheritdoc
     */
    public static $_nested = [
        Discriminator::class => 'discriminator',
        Items::class => 'items',
        Property::class => ['properties', 'property'],
        ExternalDocumentation::class => 'externalDocs',
        AdditionalProperties::class => 'additionalProperties',
        Examples::class => ['examples', 'example'],
        Attachable::class => ['attachables'],
    ];
}
