Project

parsnip

0.0
No commit activity in last 3 years
No release in over 3 years
Rack Middleware that nips parsing errors in the bud before they manifest as internal server errors
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0

Runtime

 Project Readme

Welcome to Parsnip¶ ↑

Parsnip is a rack middlware component primarily targeted to Rails 3.x developers creating RESTful apis. Particularly those tired of ActionDispatch::ParamsParser spewing internal server errors when clients supply malformed XML or JSON in the body of PUT/POST requests. Parsnip will find unparsable XML or JSON and return response with a status code of 400 and JSON or XML body content describing the parsing error encountered.

Getting Started¶ ↑

Rails: Parsnip uses the railties facility to work as a plug and play gem for Rails applications (verified with Rails 3.2.x).

  1. Add gem 'parsnip' to your Gemfile

  2. Run bundle from your project root

  3. Run rake middleware from your project root and verify that Parsnip::Middleware appears before ActionDispatch::ParamsParser