-
Notifications
You must be signed in to change notification settings - Fork 119
Closed
Description
The relationship config property key, to convert property names, only seems to work for incoming data and not for outgoing data (saving). I haven't experienced this issue with the similar attribute config property serializedName.
For example converting between camel case and dasherized.
@JsonApiModelConfig({type: 'endpoints/things'})
export class Thing extends JsonApiModel {
@BelongsTo({key: 'foo-bar'})
fooBar: FooBar;
}
@JsonApiModelConfig({type: 'endpoints/foo-bars'})
export class FooBar extends JsonApiModel { }For every retrieved Thing the fooBar property is properly set by the foo-bar property coming from the API. Saving a new Thing with a set fooBar property sends this property as fooBar to the API instead of foo-bar.
Payload to the server
{
"data": {
"relationships": {
"fooBar": {
"data": {
"type": "endpoints/foo-bars",
"id": "1"
}
}
},
"type": "endpoints/things",
"attributes": {}
}
}Is this a bug or am I missing something?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels