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

How to get examples for QueryParam of type int array working in Try it out? #827

Open majortom731 opened 3 months ago

majortom731 commented 3 months ago

Scribe version

4.33

Your question

Hi,

I'm having trouble getting the examples for an int[] query paremeter right.

My code:

#[QueryParam('product_ids', 'int', 'Array of target Product ids', true, [14617,14618])]

The example values are neither shown in the documentation for the parameter, nor included in the request when I press Try-it-out.

Things I tried:

Thank you!

Docs

shalvah commented 3 months ago

Query params are tough, because there's no HTTP standard, so different platforms handle it differentl. But your type says int. DId you try int[]? Also, what does "does not work" mean? What does the API tester send?

mikeah2011 commented 2 months ago

#[QueryParam('cid', 'integer[]', '聯盟站點 cid,支持整型數組,[1,2<sup>31</sup>-1]', false, [3789, 5954])]