-
-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Generated open api spec is unpredictable and often includes null and undefined even if not true #2469
Comments
@crtl could you update the example with all classes like businessModel and PositioningBusinessModel please? |
@mario-fehr I have added the |
@crtl sorry it was late at night yesterday and my brain was stoping to work properly. You are right does not matter much. I created a reproducer for you with
Only thing I changed was I removed the circular reference because of this error:
And could not reproduce your situation. You can finde the api.json in
Maybe you could give us a bit more info about what versions you are using. |
@mario-fehr sry for the late reply. Ive created a reproduction here crtl/nelmioApiDocBundle-reproducer it seems the problem is that doctrine mapping metadata and class constructor signatures override the type. I have created several entities in the demo:
|
Version
4.36.1
Description
It is very unpredictable what types are gnerated for properties and how, for example given the following class:
Will produce the following type in open api json:
But there is no reference to null anywhere in its type. So why are all the properties nullable and also why are they not required.
I have to manualy add each property to OA\Schema required list.
Instead it should be the other way around, properties are normally blacklisted.
Edit
AbstractPositioningModel
BusinessModel
The text was updated successfully, but these errors were encountered: