DatX is an opinionated JS/TS data store. It features support for simple property definition, references to other models and first-class TypeScript support.
This change will better align library with JSON:API mindset.
import { Model } from '@datx/core';
import { Field, jsonapiModel } from '@datx/jsonapi';
class Pet extends jsonapiModel(Model) {
static type = 'pet';
@Field()
public name: string;
@Field({ defaultValue: 0 })
public age: number;
@Field({ toOne: Person })
public owner: Person;
}
Relevant version
Relevant libraries
Breaking change
No
Description
Based on JSON:API standard
attributes
andrelationships
are both calledfields
. https://jsonapi.org/format/#document-resource-object-fieldsThis change will better align library with JSON:API mindset.