core icon indicating copy to clipboard operation
core copied to clipboard

Generated OpenApi Docs are different depending if metadata cache exists or not

Open ostrolucky opened this issue 1 year ago • 1 comments

API Platform version(s) affected: 3.4.3

Description
I was banging my head against the wall trying to figure out why locally running test passes, but on CI it fails. Then I found it fails locally as well when my cache needs to be generated. Finally, I compared before & after running tests and only significant difference is that var/cache/test/pools have now new metadata cache files

Here is the diff image

Example file

root@c49b853ae106:/srv/api# cat var/cache/test/pools/system/8s0Py00TIs/+/A/5k95jvAy2d87QtUsL8OQ
<?php //property_name_collection_a5b6522759cfc7a5bb8956432b324254

return [PHP_INT_MAX, static fn () => \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
    $o = [
        clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['ApiPlatform\\Metadata\\Property\\PropertyNameCollection'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('ApiPlatform\\Metadata\\Property\\PropertyNameCollection')),
    ],
    null,
    [
        'ApiPlatform\\Metadata\\Property\\PropertyNameCollection' => [
            'properties' => [
                [
                    'id',
                ],
            ],
        ],
    ],
    $o[0],
    []
)];

ostrolucky avatar Oct 16 '24 20:10 ostrolucky

Not sure why OpenAPIFactory doesn't generate the full cache though

soyuka avatar Oct 17 '24 08:10 soyuka

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 18 '24 04:12 stale[bot]