-
Notifications
You must be signed in to change notification settings - Fork 114
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
Nullable refs when documenting type manually #70
Comments
I found a similar issue when documenting a nullable type via PHPdoc like this:
|
@alanstriglio are you using the latest version (0.11.14)? |
I'm using 0.11.9 |
@alanstriglio try the latest. If problem persists, reopen the issue. |
I'm experiencing the same result with the latest version (0.11.14). I can't reopen this issue myself, could you please reopen it? |
I would like to add my two cents to the issue: whenever you refer to a named object in the PHPDoc it ends up using
Instead whenever you use a built-in type it ends up using an array of types and information about null is lost:
When I say "information about null is lost" is mean that This is in sharp contrast with whatever Stoplight shows for the same type when it generates the APIs documentation via the same openapi json: So there is a chance that the generated openapi JSON is correct and there could be a bug in the typescript openapi-generator. I don't know the OpenAPI 3.1 specs well enough to tell who's at fault. |
@darkbasic thanks for more explanation. Indeed, this is a valid JSON Schema and type generator should've handled it properly. So I'm closing the issue for now. |
When a type is documented via PHPDoc and future ref is used with
null
in union, information aboutnull
is lost:/** @var User|null */
The text was updated successfully, but these errors were encountered: