Skip to main content

Flask-RAML (REST API Markup Language) API server with parameter conversion, response encoding, and examples

Project description

# [Flask-RAML]( <a href=''><img align='right' title='Salsita' src='' /></a>

Flask-RAML (REST API Markup Language) API server with parameter conversion, response encoding, and examples.

[![Latest Version](]
[![Supported Python versions](]

## Supported Platforms

* [Python]( >= 2.6, 3.3
* [Flask]( >= 0.5

## Get Started

Install using [pip]( or [easy_install](
pip install Flask-RAML
easy_install Flask-RAML

Optionally, you can specify `yaml` or `raml` extras to install related dependencies:
pip install "Flask-RAML[yaml,raml]"
easy_install "Flask-RAML[yaml,raml]"

## Features

- Load [RAML]( API specification stored in any of supported markup languages using [PyDataLoader](
- Support [YAML]( using [PyYAML](
- Support [RAML]( using [pyraml-parser](
- Support [JSON]( using [Python 2.6+ json module](, or [Python 3.x json module](
- Provide enhanced [PyRAML]( API model.
- Reuse PyRAML extensible API spec loader and parameter converters.
- Use extensible [flask-mime-encoders]( for request/response body decoding/encoding.
- Provide enhanced route decorator with optional API request/response middleware layers.
- Auto-decode request body based on `Content-Type` header (for JSON, it reuses Flask auto-decoding).
- Convert and validate URI/query parameters.
- Auto-encode response with specified route encoders mimetype.
- Make it simple to serve API example response of requested/default MIME type.
- Make also simple to serve example responses for all unhandled API resources and methods.

## Tasks

- [ ] Release example API spec and Flask API server.
- [x] Create repository [flask-raml-example](
- [ ] Design a modular sample API spec with examples and reusable schemas, types, traits and markdown docs.
- [x] Add gulp tasks to generate HTML docs and YAML spec from the sample RAML API specs.
- [ ] Add gulp tasks for API testing using [abao](
- [ ] Add example app deployment from Github via API yaml/html build on CircleCI to uWSGI/Flask site on Heroku.
- [ ] Extend [raml2html]( API docs generator.
- [ ] Add parameter details (min/max lenght/value, pattern).
- [ ] Add API console for testing.
- [ ] Add autoselect encoder (based on request `Accept` header) to [flask-mime-encoders](
- [ ] Add request body JSON schema validation.
- [ ] Extend [raml-js-parser]( to embed local JSON schema references for validation.
- [ ] Optionally extend [pyraml-parser]( too.
- [ ] Add optional request body JSON schema validation to the route decorator.

## Changelog

### 0.1.5

#### Fixes

- Fix broken example view function attributes.
- Fix broken mime encoders import.

### 0.1.4

#### Fixes

- Fix PEP-8 style and method spec in view serving decorator.

### 0.1.3

#### Features

- Update PyRAML dependency to add default option to ignore empty parameters unless '' is specified in enum.

### 0.1.2

#### Fixes

- Fix package setup to not require dependencies preinstalled.

### 0.1.0

#### Features

- Initial release.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution (8.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page