You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Model properties without OA\Property annotation or attribute are included in the model's 'required' array if they aren't nullable and don't have a default value. For instance, model:
class FooBarModel
{
public int $foo;
public string $bar;
}
I tried to reproduce this bug using your description and the sample code you provided, but it worked as expected with both version 4.24.1 and the latest version 4.25.3.
Could you provide more of your code or at best a minimal, self-contained and reproducible test case?
#2277 is a quick reproduction of this bug. When I dropped #[\OpenApi\Attributes\Property(type: 'string')] and @OA\Property(type = "string") from the User::location property, this property was included in 'required' array.
It's just a demo. If this bug will be fixed, User::location must be in 'required' array even with OA\Property attribute/annotation.
Version
4.24.1
Description
Model properties without OA\Property annotation or attribute are included in the model's 'required' array if they aren't nullable and don't have a default value. For instance, model:
is described as:
But if you add OA\Property annotation or attribute:
the corresponding property won't be added to the 'required' array:
Additional context
No response
The text was updated successfully, but these errors were encountered: