Move JSONAPI towards jsonapi.org compliance #396

Closed
jessereynolds opened this Issue Jan 1, 2014 · 3 comments

Projects

None yet

1 participant

@jessereynolds
Member

@ali-graham and I have been getting a backbone.js / jquery interface going for managing contacts in flapjack. In the process of this it became apparent we'd be best off consistently wrapping (or not) all request / response json, whereas currently we're only doing this some of the time.

We decided to run with jsonapi.org's formatting specification (id-based, not url-based). This means, among other things, wrapping everything, eg:

{ "contacts": [{"id": "f01", "first_name": "Jane", ...}]}

Refer: http://jsonapi.org/format

TODO (create separate issues for):

  • wrap all contact methods #398
  • wrap all entity methods #399
  • include ids of contacts linked to entities using the links hash #400
  • include ids of entities linked to contacts using the links hash #400
  • include ids of notification rules linked to contacts using the links hash #400
  • optionally include linked documents in responses to save on api requests ("?include=notification_rules" or some such) #403
  • get the flapjack API accepting the jsonapi.org registered mime type application/vnd.api+json in addition to the current application/json bastard mime type (DONE)
  • get the backbone.js/jquery interface using the jsonapi.org registered mime type application/vnd.api+json #402
@jessereynolds jessereynolds changed the title from Move API towards jsonapi.org compliance to Move JSONAPI towards jsonapi.org compliance Apr 16, 2014
@jessereynolds
Member

@ali-graham - I'll leave this issue open to track the jsonapi feature in general. Feel free to create sub tasks, or to close this when you're ready.

@jessereynolds jessereynolds reopened this Apr 16, 2014
@ghost
ghost commented Apr 16, 2014

This is probably about 95% of the way there, modulo some brokenness around how we currently handle ids in Flapjack (and which we won't change until after the release of 1.0 for compatibility reasons). Currently a couple of methods need to be changed and some extra linkage data added to contacts, entities and their dependent objects.

@jessereynolds
Member

Implemented! Not necessarily exactly as described in this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment