JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources
Nested included resources filters
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Ruby
- Sterne
- 2.3k
- Forks
- 546
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
This issue is a (choose one):
- Problem/bug report.
- Feature request.
- Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead.
Checklist before submitting:
- I've searched for an existing issue.
- I've asked my question on Gitter and have not received a satisfactory answer.
- I've included a complete bug report template. This step helps us and allows us to see the bug without trying to reproduce the problem from your description. It helps you because you will frequently detect if it's a problem specific to your project.
- The feature I'm asking for is compliant with the JSON:API spec.
Description
Hi guys, I'm sorry about how this issue is looking, don't have time to make it better.
Currently, (checked on 0.9.5, and it's probably the same on 0.9.7) filtering on nested resources works only for 1 level deep inclusion, i.e. included_resource.filter_key. I made some monkey-patches in my app, to make it work with nested resources inclusion, i.e. included_resource.another_included_resource.filter_key.
Also, I did some changes to make filters work with has_one relationships.
The code can be a little bit messy, but it's working, at least for my project. No blame, please :)
The code is here: https://gist.github.com/RoM4iK/1ce4eab45ed0ceafa8728ed487ccddbb
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den verlinkten Gist zu prüfen und den vorhandenen Einstiegspunkt für die Ressourcenfilterung im Repository zu finden. Vergleiche das aktuelle Verhalten für Ressourcen, die eine Ebene tief verschachtelt sind, mit der angeforderten tieferen Verschachtelung und den has_one-Beziehungen. Erledigt ist die Aufgabe, wenn verschachtelte Filter auf mehreren Einbindungsebenen funktionieren, einschließlich has_one-Ressourcen, und Projekttests dieses Verhalten abdecken.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rails, ruby
- Bereich
- backend-api-design
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100