Open
Description
Turns out we never actually implemented attribute remapping, even though we exposed it in configuration options.
Given an api response like:
{
data: {
id: '12',
type: 'posts',
attributes: {
post_name: 'The Post',
body: 'body text',
},
relationships: {
the_author: {
id: '1',
type: 'people'
}
}
// ...
}
Then the following should map correctly to those attributes both reading from and writing to the API:
@Model()
class Post extends ApplicationRecord {
@Attr body : string
@Attr({ name: 'post_name' }) name : string
@BelongsTo({ name: 'the_author' }) author : Person
}
Metadata
Metadata
Assignees
Labels
No labels