Open BnitoBzh opened 2 months ago
#[QueryParam('is_api_user', 'boolean', '聯盟站點是否異業串接', false, 'true', ['true-是', 'false-否'])]
Sorry @mikeah2011 i am speaking about BodyParam not QueryParam.
If the example for a boolean BodyParam is set as string, like your comment 'true'
, the API json body sample use the type string instead of the type boolean.
In my example, the sample will be : { "newsletter": "true" }
instead of { "newsletter": true }
Yes, the string true cannot solve the problem perfectly. I have made a correction, please refer to it.
Scribe version
4.35.0
PHP version
8.3.3
Framework
Laravel
Framework version
10.43.0
Scribe config
What happened?
Attribute annontations do not render boolean examples correctly.
#[BodyParam('newsletter', 'boolean', description: 'Opt-in status for newsletter', required: true, example: true)]
#[BodyParam('newsletter', 'boolean', description: 'Opt-in status for newsletter', required: true, example: false)]
With
true
orfalse
value as example, there is no example text in the documentation and forfalse
value the curl example is correct, but with thetrue
value, the curl example is set tonull
Docs