Comments (5)
Could you show full example, please.
Because both of them right. It depends how you call it.
For instance:
resource subres => sub { ... }
and
desc 'subres desc',
resource => 'subres' => sub { ... }
from raisin.
I have 1 pm mounting 4 other pm's. I implemented only your below example, because when I use the top one then I get the afore-mentioned errors.
# /person
desc 'person-related methods',
resource => person => sub { ..
# /person/<id>
route_param id => Int,
sub {
# get person
desc "Show a person's data",
...
};
};
I didn't realize both were possible; I'll check the docs again ;-) Thanks.
from raisin.
Maybe you could give me an advice?
Is current syntax clear for you?
Maybe it would be better if I changed the syntax, where all keywords would be act as a separate subroutine?
For instance:
desc 'some action';
params required => { name => 'somename', type => Int }, optional => { name => 'optname', type => Str };
get sub {
...
};
Or it will be better to leave as it is?
from raisin.
Thanks for your feedback and checking with me.
My take on this is that unless there's a clear reason (and description) why there are 2 different notations (and when & how to use them), it might indeed be better to use only 1 consistent notation that does not allow for any guesswork.
Also, at least in my experience, too many different ways of allowing definitions and/or too much aliasing to remain backwards compatible almost invariably end up being a maintenance and testing nightmare.
You'll have to decide eventually (because there is always a risk that by refactoring this, existing (albeit only a few weeks' or months' old) code could break), but I for one will be sticking with only 1 notation, like my earlier example, as it makes the raisin
parser behave as I would expect.
Thanks again for the great work on Raisin. Very much appreciated!
Best,
Chris.
from raisin.
You can use Raisin::API '-old'
for your old API.
from raisin.
Related Issues (20)
- Optional params that fail type constraints do not return "Invalid Parameters" response.
- Encoder/Decoder are unable to cope with UTF-8 / wide characters.
- t/unit/plugin/swagger.t fails (with Type::Tiny 1.006000?) HOT 5
- Feature Request: Swagger schemes
- $count in SYNOPSIS HOT 1
- Please include VERSION in all modules HOT 4
- Authentication module in Raisin HOT 3
- Disable the route extension. HOT 2
- Ideas to discuss HOT 4
- Improvement: allow swagger to reside behind a reverse proxy
- Request for clarification HOT 3
- Reverse proxy not done correctly HOT 7
- escaping colon in resource path
- Presenting DBIx::Class::ResultSet does not work correctly HOT 6
- please tag recent CPAN releases in git HOT 1
- Regex check in Raisin::Entity flags numbers as strings for JSON::XS
- Bump version to 0.94 please? HOT 3
- route_param regex is broken by R::Routes::Endpoint::_build_regex if contains quantifiers...
- Participate in hacktoberfest?
- question: can Raisin handle file uploads ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raisin.