dedoc / scramble

Modern Laravel OpenAPI (Swagger) documentation generator. No PHPDoc annotations required.
https://scramble.dedoc.co/
MIT License
1.18k stars 112 forks source link

Add support for inferring property types on templates #531

Open cwhite92 opened 3 weeks ago

cwhite92 commented 3 weeks ago

With the following style of return:

return ['id' => $plainPhpObject->id];

scramble is generating documentation that says id is a string:

image

despite id being type hinted to an integer:

image

from dumping out in one of my extensions, I can see the following comment on the property inference:

Cannot infer type of property [id] fetch on template type: not supported yet.

After asking in Discord, it was suggested I make a GitHub issue.

Cheers!