knuckleswtf / scribe

Generate API documentation for humans from your Laravel codebase.✍
https://scribe.knuckles.wtf/laravel/
MIT License
1.59k stars 280 forks source link

add empty check for properties #712

Closed rpmccarter closed 10 months ago

rpmccarter commented 10 months ago

Objects with empty properties are being serialized as [] in the resulting openapi.yaml, which is invalid OpenAPI. This was already being handled in a couple places, just missed a few. I also replaced the $EMPTY class prop with a function that also performs the empty check.

Luckily, TheSideProjectAPI actually has an example of this bug! I tested with that repo and the fix seemed to work.

First time working in php, pointers welcome!