Skip to content

Instantly share code, notes, and snippets.

@wrightling
Created May 11, 2013 04:22
Show Gist options
  • Save wrightling/5558881 to your computer and use it in GitHub Desktop.
Save wrightling/5558881 to your computer and use it in GitHub Desktop.
Refactoring the request JSON for my rails-api. The "add_card.json" and "update_card.json" files show how my API is currently expecting the request JSON. The "take2" versions are in a format that seems more conformant with jsonapi.org.
{"card":{"subject":"some subject","contents":"longer content to be practiced"}}
{"cards":[{"subject":"some subject","contents":"longer content to be practiced"}]}
{"card":{"subject":"some subject","contents":"longer content to be practiced"}}
{"cards":[{"subject":"some subject","contents":"longer content to be practiced"}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment