Simplest Example Possible
Hey! I really like raml, and I love flask! I just stumbled upon this project and I would like to start using it. The way I understood it, having a raml file I can have a simple server like osprey does but for python.. Right? If you could provide a super small example of usage or some basic walkthrough I would like to use or contribute to this library. Cheers, Michael.
+1
I'm starting to work with RAML for an application using Flask-RESTful, and am looking at integration options.
I agree, a very simple practical example would be invaluable.
+1
Will try to do find time for a basic sample around the end of year.
For now, what about very basic:
from flask.ext.raml import API
api = API(app, path='static/docs/api/api.yaml')
# generate an all-inclusive yaml with gulp apiyaml task https://gist.github.com/iki/784ddd5ab33c1e1b726b
@api.route('/my/route/path/1', 'post')
def handler(id):
if not data:
api.abort(404, 'id does not exist');
return dict(received=True)
from handlers import handler2
api.add_route('/my/route/path/2', handler2)
More info on route params in source for now.
cc @mpetyx @freddrake @wasade @astewart-twist
This does not do any kind of payload validation, does it?