class Thing extends resourceLibrary.Base {
this.belongsTo('multiWord')
}
class MultiWord extends resourceLibrary.Base {
this.hasMany('things')
}
MultiWord's relationship on my backend is obviously declared with snake case (belongs_to :multi_word) since I'm using Rails.
If I try to create or update a Thing with its nested MultiWord, JSON:API will expect the corresponding key in the relationships hash to be kebab-case, but ActiveResourceJS automatically converts it to snake_case when making the request:
Which results in a 400 response, with an error code "105: Param multi_word is not allowed".
Bypassing ActiveResourceJS for these requests and putting in relationships: { multi-word: {...} } makes everything work...
I've tried other formats for declaring the relationship, none of which seem to work:
class Thing extends resourceLibrary.Base {
this.belongsTo('multi_word')
}
// doesn't work
class Thing extends resourceLibrary.Base {
this.belongsTo('multi-word')
}
// can't even assign the association anymore
I have the following relationship:
MultiWord
's relationship on my backend is obviously declared with snake case (belongs_to :multi_word
) since I'm using Rails.If I try to create or update a Thing with its nested MultiWord, JSON:API will expect the corresponding key in the
relationships
hash to be kebab-case, but ActiveResourceJS automatically converts it to snake_case when making the request:Which results in a 400 response, with an error code "105: Param multi_word is not allowed".
Bypassing ActiveResourceJS for these requests and putting in
relationships: { multi-word: {...} }
makes everything work...I've tried other formats for declaring the relationship, none of which seem to work: