khrt / Raisin

Raisin - a REST API micro framework for Perl 🐫 🐪
61 stars 30 forks source link

Need to 'use Raisin::Types' somewhere #2

Closed LLFourn closed 10 years ago

LLFourn commented 10 years ago

If you don't have 'use Raisin::Types' this in your RaisinApp (as in example). It will stuff up. eg

$ raisin --routes --params api.pl
GET     //user
Can't locate object method "name" via package "Raisin::Types::Integer" (perhaps you forgot to load "Raisin::Types::Integer"?) at .../bin/raisin line 62..
khrt commented 10 years ago

I decided to include use Raisin::Types into documentation rather than include Raisin::Types into Raisin application by default. I made in that way because I think that Raisin::Types is just an example types and it's not necessary to include in every user application but if user want it he/she could include it instead of making his own types.

LLFourn commented 10 years ago

On that note have you thought about using Type::Tiny https://metacpan.org/pod/Type::Tiny::Manual instead of the one you rolled yourself?

khrt commented 10 years ago

I didn't know about Type::Tiny before. It's interesting, I'll think about it.

khrt commented 10 years ago

Rewritten to able to use Type::Tiny and any compatible with it type constraints.