JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources
Documentation for ResourceSerializer with includes is incorrect
Personne n'a encore pris cette issue.
- Langage dominant
- Ruby
- Étoiles
- 2.3k
- Forks
- 546
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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. NOTE - I tried to ask in Gitter but it sends me in an infinite redirect loop when I try to sign in.
- 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. NOTE - I attempted to create a complete bug report, but I'm not sure how to use the template, and can't seem to find documentation about how it's supposed to be used and my best guess of running
ruby rails_5_master.rbdoesn't seem to work. - The feature I'm asking for is compliant with the JSON:API spec.
Description
Choose one section below and delete the other:
Bug reports:
The documentation says that ResourceSerailizer should be able to include resources by doing something like this:
post = Post.find(1)
JSONAPI::ResourceSerializer.new(PostResource,
include: ['comments'],
).serialize_to_hash(PostResource.new(post, nil))
But when I do this I don't get an included section in the serialized output.
Additionally I don't find any tests in the test suite that demonstrate the documented way of doing it, but I find several tests that seem to achieve includes via much more verbose and laborious methods.
Am I missing something?
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par la section include du guide du serializer v0.10 et comparez son exemple avec test/unit/serializer/serializer_test.rb autour des lignes 205-226. Reproduisez l’appel documenté à ResourceSerializer, puis déterminez si la documentation ou le comportement du serializer est incorrect. C’est terminé lorsque le workflow include documenté est correct et couvert par un test ciblé.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- ruby
- Domaine
- documentation
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100