SeyZ / jsonapi-serializer

A Node.js framework agnostic library for (de)serializing your data to JSON API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What is the difference between `ref` and `id`?

allthesignals opened this issue · comments

The serialization docs say the following:

ref: If present, it's considered as a relationships.
id: Configurable identifier field for the resource. Default: id.

I don't understand what one is doing over the other? What if I specify a ref but no id, and there is no id field?

Happy to contribute to clarify docs once I understand the difference.

Thanks.

So support for this library has been down. I've been recently going around the other serializers checking for people who are looking for a better serializer. Over the past few days I've designed a resource-recursive, typescript/javascript library for serializing the entire JSON:API spec. Our API is far more fluent than the one here (and every other serializer I have seen/used). If this serialize doesn't fit your need, you might want to check it out :) Development is active.

Link: https://github.com/jun-sheaf/ts-japi

@jun-sheaf oh WOW, thank you! I rely heavily on this serializer. I'll take a look. Happy to contribute as wel.