nelmio / NelmioApiDocBundle

Generates documentation for your REST API from annotations
MIT License
2.23k stars 833 forks source link

[Bug]: Not nullable with default are required #2304

Closed alxvgt closed 2 months ago

alxvgt commented 3 months ago

Version

4.27.0

Description

During our recent update from 4.26.2 to 4.27.0 some of our properties are now mark as required but i'm not sure if it should be the case.

Ex :

class Test
{
    /**
     * @OA\Property(type="array", @OA\Items(ref=@Model(type=Toto::class)))
     */
    protected array $options = [];

    protected ?string $callback = null;

In this case :

Both has default value that led to not require any value i guess ?

Additional context

No response

alxvgt commented 3 months ago

This MR is the source of then change : https://github.com/nelmio/NelmioApiDocBundle/pull/2103

deluxetom commented 2 months ago

I'm having the same issue, I think that PR should be reverted https://github.com/nelmio/NelmioApiDocBundle/pull/2103#issuecomment-2223476879

DjordyKoert commented 2 months ago

https://github.com/nelmio/NelmioApiDocBundle/pull/2103 has been reverted and is available in v4.29.0