knuckleswtf / scribe

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

feature/nullable #834

Open MertcanDinler opened 3 months ago

MertcanDinler commented 3 months ago

Support for nullable values for OpenApiSpecs. If the parameter is not required, if it is specified to be nullable with the BodyParam attribute, or if there is a nullable rule in the validation, this field will be added to the OpenApiSpecs as nullable.

shalvah commented 1 month ago

I need to think about this a bit. I see the distinction, but I'm always skeptical about adding OpenAPI-only features. I daresay, for most devs in a dynamically-typed language like PHP, a required parameter is functionally equivalent to non-null (in most cases).

liverocaisson commented 1 month ago

@MertcanDinler cc @shalvah I tried also to implement a similar nullable fonctionnality when not required -> nullable : true but tests don't pass. If someone can help. https://github.com/knuckleswtf/scribe/pull/739

jfoliveira commented 1 month ago

@MertcanDinler cc @shalvah I tried also to implement a similar nullable fonctionnality when not required -> nullable : true but tests don't pass. If someone can help. #739

@liverocaisson added more suggestions to #739 Please have a look when you have a chance.

shalvah commented 2 weeks ago

Been busy, will take a look at these sometime this week or next.