JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources
Nested attributes for relationships
Nessuno ha ancora preso questa issue.
- Lingua principale
- Ruby
- Stelle
- 2.3k
- Fork
- 546
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
If I were updating / creating a "post" and I also wanted to create / update tag id 3 in the example below, should that be possible (i.e. similar to nested attributes in active record).
Probably a bit of a bad example, but hopefully you get the idea ?
I am finding that each entry in "data" in the relationships must only contain id and type. Nowhere have I yet seen how to do this in json_api in general, not just in this gem so maybe it is not possible. In which case, I guess I would need to create / update the tag seperately, but then I may need to worry about rolling it back if the creation / update of the post did not succeed etc...
post '/posts',
{
'posts' => {
'attributes' => {
'title' => 'A great new Post'
},
'relationships' => {
'tags' => {
'data' => [
{type: 'tags', id: 3, attributes: {name: "New Tag Name"}},
{type: 'tags', id: 4}
]
}
}
}
}
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Non sono indicati file sorgente, test o punti di ingresso. Inizia esaminando la gestione esistente della creazione e dell'aggiornamento delle relazioni e le regole di JSON:API per i dati delle relazioni, quindi stabilisci se gli attributi annidati sono supportati. Il lavoro è completato quando esiste una decisione chiara, con il comportamento delle richieste e le aspettative relative alla transazione o al rollback definiti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rails, ruby
- Ambito
- api, backend-api-design
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100