vendor/api-platform/core/src/Metadata/ApiResource.php line 26

  1. <?php
  2. /*
  3.  * This file is part of the API Platform project.
  4.  *
  5.  * (c) Kévin Dunglas <dunglas@gmail.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. declare(strict_types=1);
  11. namespace ApiPlatform\Metadata;
  12. use ApiPlatform\Metadata\GraphQl\Operation as GraphQlOperation;
  13. use ApiPlatform\OpenApi\Model\Operation as OpenApiOperation;
  14. use ApiPlatform\State\OptionsInterface;
  15. /**
  16.  * Resource metadata attribute.
  17.  *
  18.  * The API Resource attribute declares the behaviors attached to a Resource inside API Platform.
  19.  * This class is immutable, and if you set a value yourself, API Platform will not override the value.
  20.  * The API Resource helps to share options with operations.
  21.  *
  22.  * Read more about how metadata works [here](/docs/in-depth/metadata).
  23.  *
  24.  * @author Antoine Bluchet <soyuka@gmail.com>
  25.  */
  26. #[\Attribute(\Attribute::TARGET_CLASS \Attribute::IS_REPEATABLE)]
  27. class ApiResource extends Metadata
  28. {
  29.     use WithResourceTrait;
  30.     protected ?Operations $operations;
  31.     /**
  32.      * @param array<int, HttpOperation>|array<string, HttpOperation>|Operations|null $operations   Operations is a list of HttpOperation
  33.      * @param array<string, Link>|array<string, mixed[]>|string[]|string|null        $uriVariables
  34.      * @param array<string, string>                                                  $headers
  35.      * @param string|callable|null                                                   $provider
  36.      * @param string|callable|null                                                   $processor
  37.      * @param mixed|null                                                             $mercure
  38.      * @param mixed|null                                                             $messenger
  39.      * @param mixed|null                                                             $input
  40.      * @param mixed|null                                                             $output
  41.      */
  42.     public function __construct(
  43.         /**
  44.          * The URI template represents your resource IRI with optional variables. It follows [RFC 6570](https://www.rfc-editor.org/rfc/rfc6570.html).
  45.          * API Platform generates this URL for you if you leave this empty.
  46.          */
  47.         protected ?string $uriTemplate null,
  48.         /**
  49.          * The short name of your resource is a unique name that identifies your resource.
  50.          * It is used within the documentation and for url generation if the `uriTemplate` is not filled. By default, this will be the name of your PHP class.
  51.          */
  52.         protected ?string $shortName null,
  53.         /**
  54.          * A description for this resource that will show on documentations.
  55.          */
  56.         protected ?string $description null,
  57.         /**
  58.          * The RDF types of this resource.
  59.          * An RDF type is usually a URI referencing how your resource is structured for the outside world. Values can be a string `https://schema.org/Book`
  60.          * or an array of string `['https://schema.org/Flight', 'https://schema.org/BusTrip']`.
  61.          */
  62.         protected string|array|null $types null,
  63.         /**
  64.          * Operations is a list of [HttpOperation](./HttpOperation).
  65.          *
  66.          * By default API Platform declares operations representing CRUD routes if you don't specify this parameter:
  67.          *
  68.          * ```php
  69.          * #[ApiResource(
  70.          *     operations: [
  71.          *         new Get(uriTemplate: '/books/{id}'),
  72.          *         // The GetCollection operation returns a list of Books.
  73.          *         new GetCollection(uriTemplate: '/books'),
  74.          *         new Post(uriTemplate: '/books'),
  75.          *         new Patch(uriTemplate: '/books/{id}'),
  76.          *         new Delete(uriTemplate: '/books/{id}'),
  77.          *     ]
  78.          * )]
  79.          *
  80.          * ```
  81.          *
  82.          * Try this live at [play.api-platform.com/api-resource](play.api-platform.com).
  83.          */
  84.         $operations null,
  85.         /**
  86.          * The `formats` option allows you to customize content negotiation. By default API Platform supports JsonLd, Hal, JsonAPI.
  87.          * For other formats we use the Symfony Serializer.
  88.          *
  89.          * ```php
  90.          * #[ApiResource(
  91.          *   formats: [
  92.          *       'jsonld' => ['application/ld+json'],
  93.          *       'jsonhal' => ['application/hal+json'],
  94.          *       'jsonapi' => ['application/vnd.api+json'],
  95.          *       'json' =>    ['application/json'],
  96.          *       'xml' =>     ['application/xml', 'text/xml'],
  97.          *       'yaml' =>    ['application/yaml'],
  98.          *       'csv' =>     ['text/csv'],
  99.          *       'html' =>    ['text/html'],
  100.          *       'myformat' =>['application/vnd.myformat'],
  101.          *   ]
  102.          * )]
  103.          * ```
  104.          *
  105.          * Learn more about custom formats in the [dedicated guide](/guides/custom-formats).
  106.          */
  107.         protected array|string|null $formats null,
  108.         /**
  109.          * The `inputFormats` option allows you to customize content negotiation for HTTP bodies:.
  110.          *
  111.          * ```php
  112.          *  #[ApiResource(formats: ['jsonld', 'csv' => ['text/csv']], operations: [
  113.          *      new Patch(inputFormats: ['json' => ['application/merge-patch+json']]),
  114.          *      new GetCollection(),
  115.          *      new Post(),
  116.          *  ])]
  117.          * ```
  118.          */
  119.         protected array|string|null $inputFormats null,
  120.         /**
  121.          * The `outputFormats` option allows you to customize content negotiation for HTTP responses.
  122.          */
  123.         protected array|string|null $outputFormats null,
  124.         /**
  125.          * The `uriVariables` configuration allows to configure to what each URI Variable.
  126.          * With [simple string expansion](https://www.rfc-editor.org/rfc/rfc6570.html#section-3.2.2), we read the input
  127.          * value and match this to the given `Link`. Note that this setting is usually used on an operation directly:.
  128.          *
  129.          * ```php
  130.          *   #[ApiResource(
  131.          *       uriTemplate: '/companies/{companyId}/employees/{id}',
  132.          *       uriVariables: [
  133.          *           'companyId' => new Link(fromClass: Company::class, toProperty: 'company']),
  134.          *           'id' => new Link(fromClass: Employee::class)
  135.          *       ],
  136.          *       operations: [new Get()]
  137.          *   )]
  138.          * ```
  139.          *
  140.          * For more examples, read our guide on [subresources](/guides/subresources).
  141.          */
  142.         protected $uriVariables null,
  143.         /**
  144.          * The `routePrefix` allows you to configure a prefix that will apply to this resource.
  145.          *
  146.          * ```php
  147.          *   #[ApiResource(
  148.          *       routePrefix: '/books',
  149.          *       operations: [new Get(uriTemplate: '/{id}')]
  150.          *   )]
  151.          * ```
  152.          *
  153.          * This resource will be accessible through `/books/{id}`.
  154.          */
  155.         protected ?string $routePrefix null,
  156.         /**
  157.          * The `defaults` option adds up to [Symfony's route defaults](https://github.com/symfony/routing/blob/8f068b792e515b25e26855ac8dc7fe800399f3e5/Route.php#L41). You can override [API Platform's defaults](https://github.com/api-platform/core/blob/6abd0fe0a69d4842eb6d5c31ef2bd6dce0e1d372/src/Symfony/Routing/ApiLoader.php#L87) if needed.
  158.          */
  159.         protected ?array $defaults null,
  160.         /**
  161.          * The `requirements` option configures the Symfony's Route requirements.
  162.          */
  163.         protected ?array $requirements null,
  164.         /**
  165.          * The `options` option configures the Symfony's Route options.
  166.          */
  167.         protected ?array $options null,
  168.         /**
  169.          * The `stateless` option configures the Symfony's Route stateless option.
  170.          */
  171.         protected ?bool $stateless null,
  172.         /**
  173.          * The `sunset` option indicates when a deprecated operation will be removed.
  174.          *
  175.          * <div data-code-selector>
  176.          *
  177.          * ```php
  178.          * <?php
  179.          * // api/src/Entity/Parchment.php
  180.          * use ApiPlatform\Metadata\ApiResource;
  181.          *
  182.          * #[ApiResource(deprecationReason: 'Create a Book instead', sunset: '01/01/2020')]
  183.          * class Parchment
  184.          * {
  185.          *     // ...
  186.          * }
  187.          * ```
  188.          *
  189.          * ```yaml
  190.          * # api/config/api_platform/resources.yaml
  191.          * resources:
  192.          *     App\Entity\Parchment:
  193.          *         - deprecationReason: 'Create a Book instead'
  194.          *           sunset: '01/01/2020'
  195.          * ```
  196.          *
  197.          * ```xml
  198.          * <?xml version="1.0" encoding="UTF-8" ?>
  199.          * <!-- api/config/api_platform/resources.xml -->
  200.          *
  201.          * <resources
  202.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  203.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  204.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  205.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  206.          *     <resource class="App\Entity\Parchment" deprecationReason="Create a Book instead" sunset="01/01/2020" />
  207.          * </resources>
  208.          * ```
  209.          *
  210.          * </div>
  211.          */
  212.         protected ?string $sunset null,
  213.         protected ?string $acceptPatch null,
  214.         protected ?int $status null,
  215.         protected ?string $host null,
  216.         protected ?array $schemes null,
  217.         protected ?string $condition null,
  218.         protected ?string $controller null,
  219.         protected ?string $class null,
  220.         /**
  221.          * The `urlGenerationStrategy` option configures the url generation strategy.
  222.          *
  223.          * See: [UrlGeneratorInterface::class](/reference/Api/UrlGeneratorInterface)
  224.          *
  225.          * <div data-code-selector>
  226.          *
  227.          * ```php
  228.          * <?php
  229.          * // api/src/Entity/Book.php
  230.          * use ApiPlatform\Metadata\ApiResource;
  231.          * use ApiPlatform\Api\UrlGeneratorInterface;
  232.          *
  233.          * #[ApiResource(urlGenerationStrategy: UrlGeneratorInterface::ABS_URL)]
  234.          * class Book
  235.          * {
  236.          *     // ...
  237.          * }
  238.          * ```
  239.          *
  240.          * ```yaml
  241.          * # api/config/api_platform/resources.yaml
  242.          * App\Entity\Book:
  243.          *     urlGenerationStrategy: !php/const ApiPlatform\Api\UrlGeneratorInterface::ABS_URL
  244.          * ```
  245.          *
  246.          * ```xml
  247.          * <?xml version="1.0" encoding="UTF-8" ?>
  248.          * <!-- api/config/api_platform/resources.xml -->
  249.          *
  250.          * <resources
  251.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  252.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  253.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  254.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  255.          *     <resource class="App\Entity\Book" urlGenerationStrategy="0" />
  256.          * </resources>
  257.          * ```
  258.          *
  259.          * </div>
  260.          */
  261.         protected ?int $urlGenerationStrategy null,
  262.         /**
  263.          * The `deprecationReason` option deprecates the current resource with a deprecation message.
  264.          *
  265.          * <div data-code-selector>
  266.          *
  267.          * ```php
  268.          * <?php
  269.          * // api/src/Entity/Parchment.php
  270.          * use ApiPlatform\Metadata\ApiResource;
  271.          *
  272.          * #[ApiResource(deprecationReason: 'Create a Book instead')]
  273.          * class Parchment
  274.          * {
  275.          *     // ...
  276.          * }
  277.          * ```
  278.          *
  279.          * ```yaml
  280.          * # api/config/api_platform/resources.yaml
  281.          * resources:
  282.          *     App\Entity\Parchment:
  283.          *         - deprecationReason: 'Create a Book instead'
  284.          * ```
  285.          *
  286.          * ```xml
  287.          * <?xml version="1.0" encoding="UTF-8" ?>
  288.          * <!-- api/config/api_platform/resources.xml -->
  289.          *
  290.          * <resources
  291.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  292.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  293.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  294.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  295.          *     <resource class="App\Entity\Parchment" deprecationReason="Create a Book instead" />
  296.          * </resources>
  297.          * ```
  298.          *
  299.          * </div>
  300.          *
  301.          * - With JSON-lD / Hydra, [an `owl:deprecated` annotation property](https://www.w3.org/TR/owl2-syntax/#Annotation_Properties) will be added to the appropriate data structure
  302.          * - With Swagger / OpenAPI, [a `deprecated` property](https://swagger.io/docs/specification/2-0/paths-and-operations/) will be added
  303.          * - With GraphQL, the [`isDeprecated` and `deprecationReason` properties](https://facebook.github.io/graphql/June2018/#sec-Deprecation) will be added to the schema
  304.          */
  305.         protected ?string $deprecationReason null,
  306.         protected ?array $headers null,
  307.         protected ?array $cacheHeaders null,
  308.         protected ?array $normalizationContext null,
  309.         protected ?array $denormalizationContext null,
  310.         protected ?bool $collectDenormalizationErrors null,
  311.         protected ?array $hydraContext null,
  312.         protected ?array $openapiContext null// TODO Remove in 4.0
  313.         protected bool|OpenApiOperation|null $openapi null,
  314.         /**
  315.          * The `validationContext` option configures the context of validation for the current ApiResource.
  316.          * You can, for instance, describe the validation groups that will be used:.
  317.          *
  318.          * ```php
  319.          * #[ApiResource(validationContext: ['groups' => ['a', 'b']])]
  320.          * ```
  321.          *
  322.          * For more examples, read our guide on [validation](/guides/validation).
  323.          */
  324.         protected ?array $validationContext null,
  325.         /**
  326.          * The `filters` option configures the filters (declared as services) available on the collection routes for the current resource.
  327.          *
  328.          * <div data-code-selector>
  329.          *
  330.          * ```php
  331.          * <?php
  332.          * // api/src/Entity/Book.php
  333.          * use ApiPlatform\Metadata\ApiResource;
  334.          *
  335.          * #[ApiResource(filters: ['app.filters.book.search'])]
  336.          * class Book
  337.          * {
  338.          *     // ...
  339.          * }
  340.          * ```
  341.          *
  342.          * ```yaml
  343.          * # api/config/api_platform/resources.yaml
  344.          * resources:
  345.          *     App\Entity\Book:
  346.          *         - filters: ['app.filters.book.search']
  347.          * ```
  348.          *
  349.          * ```xml
  350.          * <?xml version="1.0" encoding="UTF-8" ?>
  351.          * <!-- api/config/api_platform/resources.xml -->
  352.          * <resources
  353.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  354.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  355.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  356.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  357.          *     <resource class="App\Entity\Book">
  358.          *         <filters>
  359.          *             <filter>app.filters.book.search</filter>
  360.          *         </filters>
  361.          *     </resource>
  362.          * </resources>
  363.          * ```
  364.          *
  365.          * </div>
  366.          */
  367.         protected ?array $filters null,
  368.         protected ?bool $elasticsearch null,
  369.         protected $mercure null,
  370.         /**
  371.          * The `messenger` option dispatches the current resource through the Message Bus.
  372.          *
  373.          * <div data-code-selector>
  374.          *
  375.          * ```php
  376.          * <?php
  377.          * // api/src/Entity/Book.php
  378.          * use ApiPlatform\Metadata\ApiResource;
  379.          *
  380.          * #[ApiResource(messenger: true)]
  381.          * class Book
  382.          * {
  383.          *     // ...
  384.          * }
  385.          * ```
  386.          *
  387.          * ```yaml
  388.          * # api/config/api_platform/resources.yaml
  389.          * resources:
  390.          *     App\Entity\Book:
  391.          *         - messenger: true
  392.          * ```
  393.          *
  394.          * ```xml
  395.          * <?xml version="1.0" encoding="UTF-8" ?>
  396.          * <!-- api/config/api_platform/resources.xml -->
  397.          *
  398.          * <resources
  399.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  400.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  401.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  402.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  403.          *     <resource class="App\Entity\Book" messenger=true />
  404.          * </resources>
  405.          * ```
  406.          *
  407.          * </div>
  408.          *
  409.          * Note: when using `messenger=true` on a Doctrine entity, the Doctrine Processor is not called. If you want it
  410.          * to be called, you should [decorate a built-in state processor](/docs/guide/hook-a-persistence-layer-with-a-processor)
  411.          * and implement your own logic.
  412.          *
  413.          * Read [how to use Messenger with an Input object](/docs/guide/using-messenger-with-an-input-object).
  414.          *
  415.          * @var string|bool|null
  416.          */
  417.         protected $messenger null,
  418.         protected $input null,
  419.         protected $output null,
  420.         /**
  421.          * Override the default order of items in your collection. Note that this is handled by our doctrine filters such as
  422.          * the [OrderFilter](/docs/reference/Doctrine/Orm/Filter/OrderFilter).
  423.          *
  424.          * By default, items in the collection are ordered in ascending (ASC) order by their resource identifier(s). If you want to
  425.          * customize this order, you must add an `order` attribute on your ApiResource annotation:
  426.          *
  427.          * <div data-code-selector>
  428.          *
  429.          * ```php
  430.          * <?php
  431.          * // api/src/Entity/Book.php
  432.          * namespace App\Entity;
  433.          *
  434.          * use ApiPlatform\Metadata\ApiResource;
  435.          *
  436.          * #[ApiResource(order: ['foo' => 'ASC'])]
  437.          * class Book
  438.          * {
  439.          * }
  440.          * ```
  441.          *
  442.          * ```yaml
  443.          * # api/config/api_platform/resources/Book.yaml
  444.          * App\Entity\Book:
  445.          *     order:
  446.          *         foo: ASC
  447.          * ```
  448.          *
  449.          * </div>
  450.          *
  451.          * This `order` attribute is used as an array: the key defines the order field, the values defines the direction.
  452.          * If you only specify the key, `ASC` direction will be used as default.
  453.          */
  454.         protected ?array $order null,
  455.         protected ?bool $fetchPartial null,
  456.         protected ?bool $forceEager null,
  457.         /**
  458.          * The `paginationClientEnabled` option allows (or disallows) the client to enable (or disable) the pagination for the current resource.
  459.          *
  460.          * <div data-code-selector>
  461.          *
  462.          * ```php
  463.          * <?php
  464.          * // api/src/Entity/Book.php
  465.          * use ApiPlatform\Metadata\ApiResource;
  466.          *
  467.          * #[ApiResource(paginationClientEnabled: true)]
  468.          * class Book
  469.          * {
  470.          *     // ...
  471.          * }
  472.          * ```
  473.          *
  474.          * ```yaml
  475.          * # api/config/api_platform/resources.yaml
  476.          * resources:
  477.          *     App\Entity\Book:
  478.          *         - paginationClientEnabled: true
  479.          * ```
  480.          *
  481.          * ```xml
  482.          * <?xml version="1.0" encoding="UTF-8" ?>
  483.          * <!-- api/config/api_platform/resources.xml -->
  484.          *
  485.          * <resources
  486.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  487.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  488.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  489.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  490.          *     <resource class="App\Entity\Book" paginationClientEnabled=true />
  491.          * </resources>
  492.          * ```
  493.          *
  494.          * </div>
  495.          *
  496.          * The pagination can now be enabled (or disabled) by adding a query parameter named `pagination`:
  497.          * - `GET /books?pagination=false`: disabled
  498.          * - `GET /books?pagination=true`: enabled
  499.          */
  500.         protected ?bool $paginationClientEnabled null,
  501.         /**
  502.          * The `paginationClientItemsPerPage` option allows (or disallows) the client to set the number of items per page for the current resource.
  503.          *
  504.          * <div data-code-selector>
  505.          *
  506.          * ```php
  507.          * <?php
  508.          * // api/src/Entity/Book.php
  509.          * use ApiPlatform\Metadata\ApiResource;
  510.          *
  511.          * #[ApiResource(paginationClientItemsPerPage: true)]
  512.          * class Book
  513.          * {
  514.          *     // ...
  515.          * }
  516.          * ```
  517.          *
  518.          * ```yaml
  519.          * # api/config/api_platform/resources.yaml
  520.          * resources:
  521.          *     App\Entity\Book:
  522.          *         - paginationClientItemsPerPage: true
  523.          * ```
  524.          *
  525.          * ```xml
  526.          * <?xml version="1.0" encoding="UTF-8" ?>
  527.          * <!-- api/config/api_platform/resources.xml -->
  528.          *
  529.          * <resources
  530.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  531.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  532.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  533.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  534.          *     <resource class="App\Entity\Book" paginationClientItemsPerPage=true />
  535.          * </resources>
  536.          * ```
  537.          *
  538.          * </div>
  539.          *
  540.          * The number of items can now be set by adding a query parameter named `itemsPerPage`:
  541.          * - `GET /books?itemsPerPage=50`
  542.          */
  543.         protected ?bool $paginationClientItemsPerPage null,
  544.         /**
  545.          * The `paginationClientPartial` option allows (or disallows) the client to enable (or disable) the partial pagination for the current resource.
  546.          *
  547.          * <div data-code-selector>
  548.          *
  549.          * ```php
  550.          * <?php
  551.          * // api/src/Entity/Book.php
  552.          * use ApiPlatform\Metadata\ApiResource;
  553.          *
  554.          * #[ApiResource(paginationClientPartial: true)]
  555.          * class Book
  556.          * {
  557.          *     // ...
  558.          * }
  559.          * ```
  560.          *
  561.          * ```yaml
  562.          * # api/config/api_platform/resources.yaml
  563.          * resources:
  564.          *     App\Entity\Book:
  565.          *         - paginationClientPartial: true
  566.          * ```
  567.          *
  568.          * ```xml
  569.          * <?xml version="1.0" encoding="UTF-8" ?>
  570.          * <!-- api/config/api_platform/resources.xml -->
  571.          *
  572.          * <resources
  573.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  574.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  575.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  576.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  577.          *     <resource class="App\Entity\Book" paginationClientPartial=true />
  578.          * </resources>
  579.          * ```
  580.          *
  581.          * </div>
  582.          *
  583.          * The partial pagination can now be enabled (or disabled) by adding a query parameter named `partial`:
  584.          * - `GET /books?partial=false`: disabled
  585.          * - `GET /books?partial=true`: enabled
  586.          */
  587.         protected ?bool $paginationClientPartial null,
  588.         /**
  589.          * The `paginationViaCursor` option configures the cursor-based pagination for the current resource.
  590.          * Select your unique sorted field as well as the direction you'll like the pagination to go via filters.
  591.          * Note that for now you have to declare a `RangeFilter` and an `OrderFilter` on the property used for the cursor-based pagination:.
  592.          *
  593.          * <div data-code-selector>
  594.          *
  595.          * ```php
  596.          * <?php
  597.          * // api/src/Entity/Book.php
  598.          * use ApiPlatform\Metadata\ApiFilter;
  599.          * use ApiPlatform\Metadata\ApiResource;
  600.          * use ApiPlatform\Doctrine\Odm\Filter\OrderFilter;
  601.          * use ApiPlatform\Doctrine\Odm\Filter\RangeFilter;
  602.          *
  603.          * #[ApiResource(paginationPartial: true, paginationViaCursor: [['field' => 'id', 'direction' => 'DESC']])]
  604.          * #[ApiFilter(RangeFilter::class, properties: ["id"])]
  605.          * #[ApiFilter(OrderFilter::class, properties: ["id" => "DESC"])]
  606.          * class Book
  607.          * {
  608.          *     // ...
  609.          * }
  610.          * ```
  611.          *
  612.          * ```yaml
  613.          * # api/config/api_platform/resources.yaml
  614.          * resources:
  615.          *     App\Entity\Book:
  616.          *         - paginationPartial: true
  617.          *           paginationViaCursor:
  618.          *               - { field: 'id', direction: 'DESC' }
  619.          *           filters: [ 'app.filters.book.range', 'app.filters.book.order' ]
  620.          * ```
  621.          *
  622.          * ```xml
  623.          * <?xml version="1.0" encoding="UTF-8" ?>
  624.          * <!-- api/config/api_platform/resources.xml -->
  625.          *
  626.          * <resources
  627.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  628.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  629.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  630.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  631.          *     <resource class="App\Entity\Book" paginationPartial=true>
  632.          *         <filters>
  633.          *             <filter>app.filters.book.range</filter>
  634.          *             <filter>app.filters.book.order</filter>
  635.          *         </filters>
  636.          *         <paginationViaCursor>
  637.          *             <paginationField field="id" direction="DESC" />
  638.          *         </paginationViaCursor>
  639.          *     </resource>
  640.          * </resources>
  641.          * ```
  642.          *
  643.          * </div>
  644.          *
  645.          * To know more about cursor-based pagination take a look at [this blog post on medium (draft)](https://medium.com/@sroze/74fd1d324723).
  646.          */
  647.         protected ?array $paginationViaCursor null,
  648.         /**
  649.          * The `paginationEnabled` option enables (or disables) the pagination for the current resource.
  650.          *
  651.          * <div data-code-selector>
  652.          *
  653.          * ```php
  654.          * <?php
  655.          * // api/src/Entity/Book.php
  656.          * use ApiPlatform\Metadata\ApiResource;
  657.          *
  658.          * #[ApiResource(paginationEnabled: true)]
  659.          * class Book
  660.          * {
  661.          *     // ...
  662.          * }
  663.          * ```
  664.          *
  665.          * ```yaml
  666.          * # api/config/api_platform/resources.yaml
  667.          * resources:
  668.          *     App\Entity\Book:
  669.          *         - paginationEnabled: true
  670.          * ```
  671.          *
  672.          * ```xml
  673.          * <?xml version="1.0" encoding="UTF-8" ?>
  674.          * <!-- api/config/api_platform/resources.xml -->
  675.          *
  676.          * <resources
  677.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  678.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  679.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  680.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  681.          *     <resource class="App\Entity\Book" paginationEnabled=true />
  682.          * </resources>
  683.          * ```
  684.          *
  685.          * </div>
  686.          */
  687.         protected ?bool $paginationEnabled null,
  688.         /**
  689.          * The PaginationExtension of API Platform performs some checks on the `QueryBuilder` to guess, in most common
  690.          * cases, the correct values to use when configuring the Doctrine ORM Paginator: `$fetchJoinCollection`
  691.          * argument, whether there is a join to a collection-valued association.
  692.          *
  693.          * When set to `true`, the Doctrine ORM Paginator will perform an additional query, in order to get the
  694.          * correct number of results. You can configure this using the `paginationFetchJoinCollection` option:
  695.          *
  696.          * <div data-code-selector>
  697.          *
  698.          * ```php
  699.          * <?php
  700.          * // api/src/Entity/Book.php
  701.          * use ApiPlatform\Metadata\ApiResource;
  702.          *
  703.          * #[ApiResource(paginationFetchJoinCollection: false)]
  704.          * class Book
  705.          * {
  706.          *     // ...
  707.          * }
  708.          * ```
  709.          *
  710.          * ```yaml
  711.          * # api/config/api_platform/resources.yaml
  712.          * resources:
  713.          *     App\Entity\Book:
  714.          *         - paginationFetchJoinCollection: false
  715.          * ```
  716.          *
  717.          * ```xml
  718.          * <?xml version="1.0" encoding="UTF-8" ?>
  719.          * <!-- api/config/api_platform/resources.xml -->
  720.          *
  721.          * <resources
  722.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  723.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  724.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  725.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  726.          *     <resource class="App\Entity\Book" paginationFetchJoinCollection=false />
  727.          * </resources>
  728.          * ```
  729.          *
  730.          * </div>
  731.          *
  732.          * For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
  733.          */
  734.         protected ?bool $paginationFetchJoinCollection null,
  735.         /**
  736.          * The PaginationExtension of API Platform performs some checks on the `QueryBuilder` to guess, in most common
  737.          * cases, the correct values to use when configuring the Doctrine ORM Paginator: `$setUseOutputWalkers` setter,
  738.          * whether to use output walkers.
  739.          *
  740.          * When set to `true`, the Doctrine ORM Paginator will use output walkers, which are compulsory for some types
  741.          * of queries. You can configure this using the `paginationUseOutputWalkers` option:
  742.          *
  743.          * <div data-code-selector>
  744.          *
  745.          * ```php
  746.          * <?php
  747.          * // api/src/Entity/Book.php
  748.          * use ApiPlatform\Metadata\ApiResource;
  749.          *
  750.          * #[ApiResource(paginationUseOutputWalkers: false)]
  751.          * class Book
  752.          * {
  753.          *     // ...
  754.          * }
  755.          * ```
  756.          *
  757.          * ```yaml
  758.          * # api/config/api_platform/resources.yaml
  759.          * resources:
  760.          *     App\Entity\Book:
  761.          *         - paginationUseOutputWalkers: false
  762.          * ```
  763.          *
  764.          * ```xml
  765.          * <?xml version="1.0" encoding="UTF-8" ?>
  766.          * <!-- api/config/api_platform/resources.xml -->
  767.          * <resources
  768.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  769.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  770.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  771.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  772.          *     <resource class="App\Entity\Book" paginationUseOutputWalkers=false />
  773.          * </resources>
  774.          * ```
  775.          *
  776.          * </div>
  777.          *
  778.          * For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
  779.          */
  780.         protected ?bool $paginationUseOutputWalkers null,
  781.         /**
  782.          * The `paginationItemsPerPage` option defines the number of items per page for the current resource.
  783.          *
  784.          * <div data-code-selector>
  785.          *
  786.          * ```php
  787.          * <?php
  788.          * // api/src/Entity/Book.php
  789.          * use ApiPlatform\Metadata\ApiResource;
  790.          *
  791.          * #[ApiResource(paginationItemsPerPage: 30)]
  792.          * class Book
  793.          * {
  794.          *     // ...
  795.          * }
  796.          * ```
  797.          *
  798.          * ```yaml
  799.          * # api/config/api_platform/resources.yaml
  800.          * resources:
  801.          *     App\Entity\Book:
  802.          *         - paginationItemsPerPage: 30
  803.          * ```
  804.          *
  805.          * ```xml
  806.          * <?xml version="1.0" encoding="UTF-8" ?>
  807.          * <!-- api/config/api_platform/resources.xml -->
  808.          * <resources
  809.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  810.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  811.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  812.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  813.          *     <resource class="App\Entity\Book" paginationItemsPerPage=30 />
  814.          * </resources>
  815.          * ```
  816.          *
  817.          * </div>
  818.          */
  819.         protected ?int $paginationItemsPerPage null,
  820.         /**
  821.          * The `paginationMaximumItemsPerPage` option defines the maximum number of items per page for the current resource.
  822.          *
  823.          * <div data-code-selector>
  824.          *
  825.          * ```php
  826.          * <?php
  827.          * // api/src/Entity/Book.php
  828.          * use ApiPlatform\Metadata\ApiResource;
  829.          *
  830.          * #[ApiResource(paginationMaximumItemsPerPage: 50)]
  831.          * class Book
  832.          * {
  833.          *     // ...
  834.          * }
  835.          * ```
  836.          *
  837.          * ```yaml
  838.          * # api/config/api_platform/resources.yaml
  839.          * resources:
  840.          *     App\Entity\Book:
  841.          *         - paginationMaximumItemsPerPage: 50
  842.          * ```
  843.          *
  844.          * ```xml
  845.          * <?xml version="1.0" encoding="UTF-8" ?>
  846.          * <!-- api/config/api_platform/resources.xml -->
  847.          * <resources
  848.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  849.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  850.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  851.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  852.          *     <resource class="App\Entity\Book" paginationMaximumItemsPerPage=50 />
  853.          * </resources>
  854.          * ```
  855.          *
  856.          * </div>
  857.          */
  858.         protected ?int $paginationMaximumItemsPerPage null,
  859.         /**
  860.          * The `paginationPartial` option enables (or disables) the partial pagination for the current resource.
  861.          *
  862.          * <div data-code-selector>
  863.          *
  864.          * ```php
  865.          * <?php
  866.          * // api/src/Entity/Book.php
  867.          * use ApiPlatform\Metadata\ApiResource;
  868.          *
  869.          * #[ApiResource(paginationPartial: true)]
  870.          * class Book
  871.          * {
  872.          *     // ...
  873.          * }
  874.          * ```
  875.          *
  876.          * ```yaml
  877.          * # api/config/api_platform/resources.yaml
  878.          * resources:
  879.          *     App\Entity\Book:
  880.          *         - paginationPartial: true
  881.          * ```
  882.          *
  883.          * ```xml
  884.          * <?xml version="1.0" encoding="UTF-8" ?>
  885.          * <!-- api/config/api_platform/resources.xml -->
  886.          * <resources
  887.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  888.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  889.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  890.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  891.          *     <resource class="App\Entity\Book" paginationPartial=true />
  892.          * </resources>
  893.          * ```
  894.          *
  895.          * </div>
  896.          */
  897.         protected ?bool $paginationPartial null,
  898.         /**
  899.          * The `paginationType` option defines the type of pagination (`page` or `cursor`) to use for the current resource.
  900.          *
  901.          * <div data-code-selector>
  902.          *
  903.          * ```php
  904.          * <?php
  905.          * // api/src/Entity/Book.php
  906.          * use ApiPlatform\Metadata\ApiResource;
  907.          *
  908.          * #[ApiResource(paginationType: 'page')]
  909.          * class Book
  910.          * {
  911.          *     // ...
  912.          * }
  913.          * ```
  914.          *
  915.          * ```yaml
  916.          * # api/config/api_platform/resources.yaml
  917.          * resources:
  918.          *     App\Entity\Book:
  919.          *         - paginationType: page
  920.          * ```
  921.          *
  922.          * ```xml
  923.          * <?xml version="1.0" encoding="UTF-8" ?>
  924.          * <!-- api/config/api_platform/resources.xml -->
  925.          * <resources
  926.          *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
  927.          *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  928.          *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
  929.          *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
  930.          *     <resource class="App\Entity\Book" paginationType="page" />
  931.          * </resources>
  932.          * ```
  933.          *
  934.          * </div>
  935.          */
  936.         protected ?string $paginationType null,
  937.         protected string|\Stringable|null $security null,
  938.         protected ?string $securityMessage null,
  939.         protected string|\Stringable|null $securityPostDenormalize null,
  940.         protected ?string $securityPostDenormalizeMessage null,
  941.         protected string|\Stringable|null $securityPostValidation null,
  942.         protected ?string $securityPostValidationMessage null,
  943.         protected ?bool $compositeIdentifier null,
  944.         protected ?array $exceptionToStatus null,
  945.         protected ?bool $queryParameterValidationEnabled null,
  946.         protected ?array $links null,
  947.         protected ?array $graphQlOperations null,
  948.         $provider null,
  949.         $processor null,
  950.         protected ?OptionsInterface $stateOptions null,
  951.         array|Parameters|null $parameters null,
  952.         protected array $extraProperties = [],
  953.     ) {
  954.         parent::__construct(
  955.             shortName$shortName,
  956.             class: $class,
  957.             description$description,
  958.             urlGenerationStrategy$urlGenerationStrategy,
  959.             deprecationReason$deprecationReason,
  960.             normalizationContext$normalizationContext,
  961.             denormalizationContext$denormalizationContext,
  962.             collectDenormalizationErrors$collectDenormalizationErrors,
  963.             validationContext$validationContext,
  964.             filters$filters,
  965.             elasticsearch$elasticsearch,
  966.             mercure$mercure,
  967.             messenger$messenger,
  968.             input$input,
  969.             output$output,
  970.             order$order,
  971.             fetchPartial$fetchPartial,
  972.             forceEager$forceEager,
  973.             paginationEnabled$paginationEnabled,
  974.             paginationType$paginationType,
  975.             paginationItemsPerPage$paginationItemsPerPage,
  976.             paginationMaximumItemsPerPage$paginationMaximumItemsPerPage,
  977.             paginationPartial$paginationPartial,
  978.             paginationClientEnabled$paginationClientEnabled,
  979.             paginationClientItemsPerPage$paginationClientItemsPerPage,
  980.             paginationClientPartial$paginationClientPartial,
  981.             paginationFetchJoinCollection$paginationFetchJoinCollection,
  982.             paginationUseOutputWalkers$paginationUseOutputWalkers,
  983.             security$security,
  984.             securityMessage$securityMessage,
  985.             securityPostDenormalize$securityPostDenormalize,
  986.             securityPostDenormalizeMessage$securityPostDenormalizeMessage,
  987.             securityPostValidation$securityPostValidation,
  988.             securityPostValidationMessage$securityPostValidationMessage,
  989.             provider$provider,
  990.             processor$processor,
  991.             stateOptions$stateOptions,
  992.             parameters$parameters,
  993.             extraProperties$extraProperties
  994.         );
  995.         $this->operations null === $operations null : new Operations($operations);
  996.         $this->provider $provider;
  997.         $this->processor $processor;
  998.         if (\is_string($types)) {
  999.             $this->types = (array) $types;
  1000.         }
  1001.     }
  1002.     public function getOperations(): ?Operations
  1003.     {
  1004.         return $this->operations;
  1005.     }
  1006.     public function withOperations(Operations $operations): self
  1007.     {
  1008.         $self = clone $this;
  1009.         $self->operations $operations;
  1010.         $self->operations->sort();
  1011.         return $self;
  1012.     }
  1013.     public function getUriTemplate(): ?string
  1014.     {
  1015.         return $this->uriTemplate;
  1016.     }
  1017.     public function withUriTemplate(string $uriTemplate): self
  1018.     {
  1019.         $self = clone $this;
  1020.         $self->uriTemplate $uriTemplate;
  1021.         return $self;
  1022.     }
  1023.     public function getTypes(): ?array
  1024.     {
  1025.         return $this->types;
  1026.     }
  1027.     /**
  1028.      * @param string[]|string $types
  1029.      */
  1030.     public function withTypes(array|string $types): self
  1031.     {
  1032.         $self = clone $this;
  1033.         $self->types = (array) $types;
  1034.         return $self;
  1035.     }
  1036.     /**
  1037.      * @return array|mixed|string|null
  1038.      */
  1039.     public function getFormats()
  1040.     {
  1041.         return $this->formats;
  1042.     }
  1043.     public function withFormats(mixed $formats): self
  1044.     {
  1045.         $self = clone $this;
  1046.         $self->formats $formats;
  1047.         return $self;
  1048.     }
  1049.     /**
  1050.      * @return array|mixed|string|null
  1051.      */
  1052.     public function getInputFormats()
  1053.     {
  1054.         return $this->inputFormats;
  1055.     }
  1056.     /**
  1057.      * @param mixed|null $inputFormats
  1058.      */
  1059.     public function withInputFormats($inputFormats): self
  1060.     {
  1061.         $self = clone $this;
  1062.         $self->inputFormats $inputFormats;
  1063.         return $self;
  1064.     }
  1065.     /**
  1066.      * @return array|mixed|string|null
  1067.      */
  1068.     public function getOutputFormats()
  1069.     {
  1070.         return $this->outputFormats;
  1071.     }
  1072.     /**
  1073.      * @param mixed|null $outputFormats
  1074.      */
  1075.     public function withOutputFormats($outputFormats): self
  1076.     {
  1077.         $self = clone $this;
  1078.         $self->outputFormats $outputFormats;
  1079.         return $self;
  1080.     }
  1081.     /**
  1082.      * @return array<string, Link>|array<string, array>|string[]|string|null
  1083.      */
  1084.     public function getUriVariables()
  1085.     {
  1086.         return $this->uriVariables;
  1087.     }
  1088.     /**
  1089.      * @param array<string, Link>|array<string, array>|string[]|string|null $uriVariables
  1090.      */
  1091.     public function withUriVariables($uriVariables): self
  1092.     {
  1093.         $self = clone $this;
  1094.         $self->uriVariables $uriVariables;
  1095.         return $self;
  1096.     }
  1097.     public function getRoutePrefix(): ?string
  1098.     {
  1099.         return $this->routePrefix;
  1100.     }
  1101.     public function withRoutePrefix(string $routePrefix): self
  1102.     {
  1103.         $self = clone $this;
  1104.         $self->routePrefix $routePrefix;
  1105.         return $self;
  1106.     }
  1107.     public function getDefaults(): ?array
  1108.     {
  1109.         return $this->defaults;
  1110.     }
  1111.     public function withDefaults(array $defaults): self
  1112.     {
  1113.         $self = clone $this;
  1114.         $self->defaults $defaults;
  1115.         return $self;
  1116.     }
  1117.     public function getRequirements(): ?array
  1118.     {
  1119.         return $this->requirements;
  1120.     }
  1121.     public function withRequirements(array $requirements): self
  1122.     {
  1123.         $self = clone $this;
  1124.         $self->requirements $requirements;
  1125.         return $self;
  1126.     }
  1127.     public function getOptions(): ?array
  1128.     {
  1129.         return $this->options;
  1130.     }
  1131.     public function withOptions(array $options): self
  1132.     {
  1133.         $self = clone $this;
  1134.         $self->options $options;
  1135.         return $self;
  1136.     }
  1137.     public function getStateless(): ?bool
  1138.     {
  1139.         return $this->stateless;
  1140.     }
  1141.     public function withStateless(bool $stateless): self
  1142.     {
  1143.         $self = clone $this;
  1144.         $self->stateless $stateless;
  1145.         return $self;
  1146.     }
  1147.     public function getSunset(): ?string
  1148.     {
  1149.         return $this->sunset;
  1150.     }
  1151.     public function withSunset(string $sunset): self
  1152.     {
  1153.         $self = clone $this;
  1154.         $self->sunset $sunset;
  1155.         return $self;
  1156.     }
  1157.     public function getAcceptPatch(): ?string
  1158.     {
  1159.         return $this->acceptPatch;
  1160.     }
  1161.     public function withAcceptPatch(string $acceptPatch): self
  1162.     {
  1163.         $self = clone $this;
  1164.         $self->acceptPatch $acceptPatch;
  1165.         return $self;
  1166.     }
  1167.     public function getStatus(): ?int
  1168.     {
  1169.         return $this->status;
  1170.     }
  1171.     public function withStatus($status): self
  1172.     {
  1173.         $self = clone $this;
  1174.         $self->status $status;
  1175.         return $self;
  1176.     }
  1177.     public function getHost(): ?string
  1178.     {
  1179.         return $this->host;
  1180.     }
  1181.     public function withHost(string $host): self
  1182.     {
  1183.         $self = clone $this;
  1184.         $self->host $host;
  1185.         return $self;
  1186.     }
  1187.     public function getSchemes(): ?array
  1188.     {
  1189.         return $this->schemes;
  1190.     }
  1191.     public function withSchemes(array $schemes): self
  1192.     {
  1193.         $self = clone $this;
  1194.         $self->schemes $schemes;
  1195.         return $self;
  1196.     }
  1197.     public function getCondition(): ?string
  1198.     {
  1199.         return $this->condition;
  1200.     }
  1201.     public function withCondition(string $condition): self
  1202.     {
  1203.         $self = clone $this;
  1204.         $self->condition $condition;
  1205.         return $self;
  1206.     }
  1207.     public function getController(): ?string
  1208.     {
  1209.         return $this->controller;
  1210.     }
  1211.     public function withController(string $controller): self
  1212.     {
  1213.         $self = clone $this;
  1214.         $self->controller $controller;
  1215.         return $self;
  1216.     }
  1217.     public function getHeaders(): ?array
  1218.     {
  1219.         return $this->headers;
  1220.     }
  1221.     public function withHeaders(array $headers): self
  1222.     {
  1223.         $self = clone $this;
  1224.         $self->headers $headers;
  1225.         return $self;
  1226.     }
  1227.     public function getCacheHeaders(): ?array
  1228.     {
  1229.         return $this->cacheHeaders;
  1230.     }
  1231.     public function withCacheHeaders(array $cacheHeaders): self
  1232.     {
  1233.         $self = clone $this;
  1234.         $self->cacheHeaders $cacheHeaders;
  1235.         return $self;
  1236.     }
  1237.     /**
  1238.      * @return string[]|null
  1239.      */
  1240.     public function getHydraContext(): ?array
  1241.     {
  1242.         return $this->hydraContext;
  1243.     }
  1244.     public function withHydraContext(array $hydraContext): self
  1245.     {
  1246.         $self = clone $this;
  1247.         $self->hydraContext $hydraContext;
  1248.         return $self;
  1249.     }
  1250.     /**
  1251.      * TODO Remove in 4.0.
  1252.      *
  1253.      * @deprecated
  1254.      */
  1255.     public function getOpenapiContext(): ?array
  1256.     {
  1257.         return $this->openapiContext;
  1258.     }
  1259.     /**
  1260.      * TODO Remove in 4.0.
  1261.      *
  1262.      * @deprecated
  1263.      */
  1264.     public function withOpenapiContext(array $openapiContext): self
  1265.     {
  1266.         $self = clone $this;
  1267.         $self->openapiContext $openapiContext;
  1268.         return $self;
  1269.     }
  1270.     public function getOpenapi(): bool|OpenApiOperation|null
  1271.     {
  1272.         return $this->openapi;
  1273.     }
  1274.     public function withOpenapi(bool|OpenApiOperation $openapi): self
  1275.     {
  1276.         $self = clone $this;
  1277.         $self->openapi $openapi;
  1278.         return $self;
  1279.     }
  1280.     public function getPaginationViaCursor(): ?array
  1281.     {
  1282.         return $this->paginationViaCursor;
  1283.     }
  1284.     public function withPaginationViaCursor(array $paginationViaCursor): self
  1285.     {
  1286.         $self = clone $this;
  1287.         $self->paginationViaCursor $paginationViaCursor;
  1288.         return $self;
  1289.     }
  1290.     public function getExceptionToStatus(): ?array
  1291.     {
  1292.         return $this->exceptionToStatus;
  1293.     }
  1294.     public function withExceptionToStatus(array $exceptionToStatus): self
  1295.     {
  1296.         $self = clone $this;
  1297.         $self->exceptionToStatus $exceptionToStatus;
  1298.         return $self;
  1299.     }
  1300.     /**
  1301.      * @return GraphQlOperation[]
  1302.      */
  1303.     public function getGraphQlOperations(): ?array
  1304.     {
  1305.         return $this->graphQlOperations;
  1306.     }
  1307.     public function withGraphQlOperations(array $graphQlOperations): self
  1308.     {
  1309.         $self = clone $this;
  1310.         $self->graphQlOperations $graphQlOperations;
  1311.         return $self;
  1312.     }
  1313.     public function getLinks(): ?array
  1314.     {
  1315.         return $this->links;
  1316.     }
  1317.     /**
  1318.      * @param Link[] $links
  1319.      */
  1320.     public function withLinks(array $links): self
  1321.     {
  1322.         $self = clone $this;
  1323.         $self->links $links;
  1324.         return $self;
  1325.     }
  1326. }