The yesod-raml package

[ Tags: library, mit, web, yesod ] [ Propose Tags ]

RAML style route definitions for Yesod

[Skip to Readme]


Versions 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.2.0
Change log
Dependencies aeson, base (==4.*), bytestring, containers, data-default, network-uri, regex-posix, template-haskell, text, th-lift, unordered-containers, vector, yaml, yesod-core [details]
License MIT
Author Junji Hashimoto
Category Web, Yesod
Bug tracker
Source repo head: git clone
Uploaded Fri Nov 6 14:05:30 UTC 2015 by junjihashimoto
Distributions NixOS:0.2.0
Downloads 1233 total (17 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-11-14 [all 2 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for yesod-raml-0.2.0

[back to package description]


Yesod-Raml makes routes definition from RAML File.

RAML style routes definition is inspired by sbt-play-raml.


Use parseRamlRoutes or parseRamlRoutesFile in instead of parseRoutes or parseRoutesFile.

Write RAML with handler-tag for Yesod Handler.

handler-tag is not a tag of RAML spec but original one.

You can use description-tag with handler: <<handler-name>> instead of handler-tag.

Bracket variable(PathPiece) like {hogehoge} is capitalized. The variable becomes #Hogehoge. because variable(PathPiece) of yesod-routes is data-type like String or Text.

Examples are below.

type Userid = String

mkYesod "App" [parseRamlRoutes|
#%RAML 0.8
title: Hoge API
baseUri: 'https://hoge/api/{version}'
version: v1
protocols: [ HTTPS ]
# handler tag is used.
    handler: HogeR
      description: Get user list
# handler is written in description-tag
      description: |
        handler: Hoge2R
        description: Delete user

This is the same as following codes.

As you can see, {userid} becomes #Userid.

type Userid = String

mkYesod "App" [parseRoutes|
/api/v1/user/#Userid HogeR GET
/api/v1/user/#Userid/del Hoge2R POST