JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources
Issue with namespaced resource
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
I'm running into difficulty with STI models and their corresponding resources.
I have a base model Event, with subclasses Events::Applied, Events::Interview (amongst others) and I'm not sure how to set up the resources. Currently I have an Api::V1::EventResource and Api::V1::Events::AppliedResource and Api::V1::Events::InterviewResource (both of which subclass the EventResource, however I'm getting an error NameError (JSONAPI: Could not find resource 'events/applied'. (Class Events::AppliedResource not found)) - it appears that my base namespace Api::V1 isn't being taken into account?
I'm also not sure how to handle model inheritance as a whole when it comes to JSONAPI::Resources. I'd like to have the base resource for index actions (immutable) and the subclass resources for create/updates (as well as index/show). Does this fit the pattern correctly? I'm certainly open to suggestions.
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
L’issue non indica file, test o punti di ingresso. Inizia tracciando la ricerca delle risorse di JSONAPI::Resources per i modelli STI con namespace mostrati e verificando come vengono risolte le risorse ereditate. Il lavoro è completo quando si determina se la disposizione di namespace ed ereditarietà è supportata, oppure si documenta la configurazione delle risorse necessaria e si riproduce il risultato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rails, ruby
- Ambito
- api, backend
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100