Luracast / Restler

Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and/or RESTful API
http://luracast.com/products/restler/
GNU Lesser General Public License v2.1
1.36k stars 315 forks source link

Would like a UUID type #569

Closed grosch closed 6 years ago

grosch commented 7 years ago

It's pretty common to use a UUID type as the 'key' for url components. What do you think about providing a {@type uuid} modifier, or even easier just having '@param uuid $uid' for the type.

Right now all my uid params have to put {@min 36} {@max 36} on them. I'm thinking that could be built in, as well as maybe even doing a regex match to make sure it's in the right format.

grosch commented 6 years ago

It looks like you're just looking for a 36 character alpha-numeric string, which will let invalid things in. Would be better to really check the UUID format, like at https://gist.github.com/joel-james/3a6201861f12a7acf4f2

Arul- commented 6 years ago

I checked the gist, it works on v4 UUID but fails on v1

Arul- commented 6 years ago

Above commit works for both

grosch commented 6 years ago

Yes but if I pass in a string of just 36 zeros it will also pass.

Arul- commented 6 years ago

@grosch Please check the commit! see the tests as well!

grosch commented 6 years ago

Awesome, that looks much better. Thank you! When's the the official release gonna be? You've been RC6 for years now :P