Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
The documentation for the RestResource annotation describes the wrong namespace for a "working example" .
/**
* Defines a REST resource annotation object.
*
* Plugin Namespace: Plugin\rest\resource
*
* For a working example, see \Drupal\rest\Plugin\rest\resource\DBLogResource
Proposed resolution
Either change the namespace to where the DBLogResource resides:
The DBLogResource is not there but in \Drupal\dblog\Plugin\rest\resource\DBLogResource.
or change it to the EntityResource:
The EntityResource does exist at the namespace in the example (\Drupal\rest\Plugin\rest\resource\EntityResource).
Comment | File | Size | Author |
---|---|---|---|
#22 | interdiff-22.txt | 670 bytes | joshi.rohit100 |
#22 | 2426331-22.patch | 644 bytes | joshi.rohit100 |
#20 | docs_restresource-2426331-20.patch | 647 bytes | rajeevk |
#15 | docs_restresource-2426331-15.patch | 647 bytes | rajeevk |
#13 | docs_restresource-2426331-12.patch | 647 bytes | rajeevk |
Comments
Comment #1
thijsvdanker CreditAttribution: thijsvdanker commentedChanged the example in to \Drupal\rest\Plugin\rest\resource\EntityResource as that is part of the same module.
Comment #2
klausiI think we should just mention both classes, since the dblog one is so simple and a good starting point.
Comment #3
rajeevkSorry for jumping in. But had some time to spend, so this is what I did -
Hope it helps..
Comment #7
cilefen CreditAttribution: cilefen commented@RajeevK Be sure to `git pull` then try the change again.
You forgot to remove the line with the wrong documentation.
Comment #8
rajeevkOh..file syntax was changed in the mean time. So had to create new patch from updated code.
Thanks @cilefen
Comment #9
klausiwhy do you duplicate the string, this can be just "For a working example, see \Drupal\rest\Plugin\rest\resource\DBLogResource or \Drupal\rest\Plugin\rest\resource\EntityResource.
Comment #10
rajeevkComment #11
klausiComments should wrap at 80 characters, see https://www.drupal.org/coding-standards/docs#drupal
Comment #12
naveenvalechaComment #13
rajeevkComment #15
rajeevkSubmitting again with correct patch name as per comment number.
Comment #16
klausiwhy do you break the line so early? Shouldn't the "see" be on the line before as it still fits? Same for the "or"?
Comment #18
naveenvalechaRetested #12
Comment #19
klausimy comment from #16 still applies.
Comment #20
rajeevkComment #21
klausiThe first example still fits on the same line, we don't have to break that early.
Comment #22
joshi.rohit100Comment #23
klausiThis was fixed by #2513264: Fix bad class reference in the meantime.