Skip to content

Conversation

@makepanic
Copy link
Contributor

tries to fix #31 Most of the code is inspired by the json-serializer and json-api-serializer serialize method.
They're a couple open questions:

  • how should we handle links in the serializer? We could add a flag where the method adds the metadata links to the serialized document
  • are there any cases that should be tested except the ones in the new serialize-test.js?

@bantic
Copy link
Member

bantic commented Sep 3, 2015

Cool, thanks for putting this together. I am going to look over it tomorrow. My instinct is that, since HAL doesn't specify outgoing formatting, we should defer this entirely to Ember Data. A HAL backend could theoretically accept any sort of incoming payload; the APIS I have worked with have not expected to get incoming HAL-formatted responses (only to send outgoing HAL-formatted JSON), but maybe there are some that do.

@makepanic
Copy link
Contributor Author

What about providing a mixin that contains the serialize method to serialize to a HAL document? (or providing a serializer that exports the current one with the HAL serialize method applied)

I think it's useful to provide "HAL in, HAL out" support out of the box or make it really easy to add.

@mixonic
Copy link
Member

mixonic commented Sep 6, 2015

@makepanic HAL has no out, it is specifically designed as a read-only format only. That there is no prescription for making changes is a limitation of the spec.

So to be clear, this change to HAL-9000 does not align us more closely, or move us further away from, the actual spec. Our decision is completely our own here.

hootbah added a commit to hootbah/ember-data-hal-9000 that referenced this pull request Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible incorrect format being sent on save

3 participants