Falkland CMS

68 thoughts
last posted Oct. 1, 2013, 2:19 p.m.

1 earlier thought

0

Day 2 - June 25 , 2013

Working on making creating items API more robust.

Wrote back to Billy on the liberator list thanking him for his guidance on adding to the context from a decision.

Added exception handling and logging to the JSON parsing on item create to make it more robust.

Added check of valid-new-item? for the :processable decision on the create item POST. It checks for bad collections, no name, and slug conflicts.

Worked on getting a bad collection in the create item to return a 404. Got the attempt to return the 404, but since the media type is my own custom one, it's failing because liberator doesn't know how to render-map-generic for that type. Wrote to the liberator mailing list about the problem.

Billy wrote back explaining liberator was trying to coerce the handler's response to the mime-type, and it needs to be wrapped as an explicit ring-response to avoid this and have it handle the raw map as the response. I made this simple fix.

Realized having item and creation listing in the collection controller because they operate on a controller is not right. Refactored them into the items controller.

66 later thoughts