nicklandgrebe / active-resource.js

ActiveResource.js - API resource relational mapping in JavaScript
https://active-resource.js.org
MIT License
133 stars 20 forks source link

Why id is a part of attributes object #35

Closed antonkomarev closed 5 years ago

antonkomarev commented 5 years ago
Project.find('1').then(project => {
    console.log(project.attributes()); // { id: '1', name: 'test' }
});

Why id key is a part of the attributes?

nicklandgrebe commented 5 years ago

This library was not designed with only JSON:API in mind, JSON:API is only the starting point and many other standards may consider ID to be an attribute