Skip to content
Tags

Maru Models: JSON to Erlang Record with Custom Types

by on September 26, 2012

Working with Erlang for writing RESTful interfaces JSON is the communication “language” of choice. For simplifying the process of JSON to a model the backend could work with efficiently I’ve created maru_models. This app decodes the JSON with jiffy and uses functions generated by a modified version of Ulf’s exprecs to create an Erlang record. The generated functions are created with type information from the record definition and when a property is set for the record through these functions it is first passed to the convert function of maru_model_types to do any necessary processing.

I separated this application into a separate repo to simplify people trying the examples. But the real development will be done in the Maru main repo.

About these ads

From → Erlang

3 Comments
  1. Tobias Florek permalink

    where is the repo to be found. it is not (yet?) in your github repos.

    • Tristan Sloughter permalink

      I actually removed the separate repo for now and it only lies under maru itself: https://github.com/tsloughter/maru/tree/master/lib/maru_models

      I haven’t had time to work on it in a while but plan to get maru in to proper shape, and switched to cowboy, some time soon.

      • Tobias Florek permalink

        ok, ic.

        i was aware of your maru repository and was even copying parts of your maru_models code into a toy project of mine. looking forward to your porting to cowboy :).

        given the date of the post, i thought maru_models had seen some work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: