vt-elixir / ja_serializer

JSONAPI.org Serialization in Elixir.
Other
640 stars 148 forks source link

Rendering response with only meta (no data or errors) #223

Open lleger opened 7 years ago

lleger commented 7 years ago

From the spec:

A document MUST contain at least one of the following top-level members:

  • data: the document’s “primary data”
  • errors: an array of error objects
  • meta: a meta object that contains non-standard meta-information.

It's theoretically compliant to render a response that doesn't have either a data or errors block and just a meta block. Is it possible to do this? I tried passing both nil and an empty map to the formatter in place of data with no luck with no luck.

alanpeabody commented 7 years ago

@lleger no, not currently, we could add support for it though.