• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 13471447230

22 Feb 2025 09:00AM UTC coverage: 8.516%. Remained the same
13471447230

push

github

web-flow
feat: add checkMode parameter to control json schema validation (#6974)

0 of 2 new or added lines in 1 file covered. (0.0%)

10870 existing lines in 366 files now uncovered.

13370 of 156994 relevant lines covered (8.52%)

22.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/Symfony/Action/EntrypointAction.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Symfony\Action;
15

16
use ApiPlatform\Documentation\Entrypoint;
17
use ApiPlatform\Metadata\Get;
18
use ApiPlatform\Metadata\Resource\Factory\ResourceNameCollectionFactoryInterface;
19
use ApiPlatform\Metadata\Resource\ResourceNameCollection;
20
use ApiPlatform\OpenApi\Serializer\LegacyOpenApiNormalizer;
21
use ApiPlatform\State\ProcessorInterface;
22
use ApiPlatform\State\ProviderInterface;
23
use Symfony\Component\HttpFoundation\Request;
24

25
/**
26
 * Generates the API entrypoint.
27
 *
28
 * @author Kévin Dunglas <dunglas@gmail.com>
29
 */
30
final class EntrypointAction
31
{
32
    private static ResourceNameCollection $resourceNameCollection;
33

34
    public function __construct(
35
        private readonly ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory,
36
        private readonly ProviderInterface $provider,
37
        private readonly ProcessorInterface $processor,
38
        private readonly array $documentationFormats = [],
39
    ) {
UNCOV
40
    }
32✔
41

42
    public function __invoke(Request $request)
43
    {
UNCOV
44
        static::$resourceNameCollection = $this->resourceNameCollectionFactory->create();
32✔
UNCOV
45
        $context = [
32✔
UNCOV
46
            'request' => $request,
32✔
UNCOV
47
            'spec_version' => (string) $request->query->get(LegacyOpenApiNormalizer::SPEC_VERSION),
32✔
UNCOV
48
        ];
32✔
UNCOV
49
        $request->attributes->set('_api_platform_disable_listeners', true);
32✔
UNCOV
50
        $operation = new Get(
32✔
UNCOV
51
            outputFormats: $this->documentationFormats,
32✔
UNCOV
52
            read: true,
32✔
UNCOV
53
            serialize: true,
32✔
UNCOV
54
            class: Entrypoint::class,
32✔
UNCOV
55
            provider: [self::class, 'provide']
32✔
UNCOV
56
        );
32✔
UNCOV
57
        $request->attributes->set('_api_operation', $operation);
32✔
UNCOV
58
        $body = $this->provider->provide($operation, [], $context);
32✔
UNCOV
59
        $operation = $request->attributes->get('_api_operation');
32✔
60

UNCOV
61
        return $this->processor->process($body, $operation, [], $context);
32✔
62
    }
63

64
    public static function provide(): Entrypoint
65
    {
UNCOV
66
        return new Entrypoint(static::$resourceNameCollection);
22✔
67
    }
68
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc