Closed (fixed)
Project:
JSON:API
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Jul 2018 at 15:42 UTC
Updated:
12 Oct 2018 at 10:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gabesulliceFixed issue link in summary
Comment #3
gabesulliceLet's get this going.
First, let's point all the routes away from the request handler and directly at the appropriate
EntityResourcemethods.Comment #4
gabesulliceNow we can remove the RequestHandler class completely.
Comment #5
gabesulliceFor the same reason that we renamed the parameter from 'node' to 'entity' (i.e. so that the arguments resolver would work) in #2987609: Rename the entity parameter from the entity type ID to 'entity' for all routes, we need to rename the
$related_fieldparameter to$relatedbecause that's what our route definitions declare.Comment #6
gabesulliceFinally, let's make update
Unit\RoutesTest.phpComment #8
gabesulliceNeeded a reroll for #2949807: Spec Compliance: Error responses are missing the `jsonapi` top-level member.
Marking this PP-1 because it depends on #2987609: Rename the entity parameter from the entity type ID to 'entity' for all routes.
Comment #9
gabesulliceI included a commit that I intend to make a follow up for.
Comment #10
wim leersThe
2987610-9.patchpatch was incorrect. I solved it by applying2987610-9.patchand then revertinginterdiff-removed-from-patch.txt.Intended patch attached.
Comment #11
wim leersFix for #9's failure.
Comment #12
wim leers🚀😍
This is to allow Drupal's routing system to handle this for us, right?
Question: why change these signatures if we could also just update this in
Routes:$relationship_route->addDefaults(['related' => $relationship_field_name]);to
$relationship_route->addDefaults(['related_field' => $relationship_field_name]);That'd make this patch much smaller.
👏
It's no longer a front controller. It's just a controller. (Albeit the only one, at least for now.)
I'd either rename this to
CONTROLLER, or … get rid of it altogether, and just write, for example.
Übernit: I <3 this whitespace, but Drupal core does not allow it.
🤘
Nit: s/12 routes/12 relationship routes/
Comment #13
gabesullice#2987609: Rename the entity parameter from the entity type ID to 'entity' for all routes landed.
Comment #14
gabesulliceUnfortunately, this is still blocked by #2987608: Move deserialization from RequestHandler to JsonApiParamEnhancer.
Comment #15
gabesulliceComment #16
gabesulliceRerolled to be applied after #2987608: Move deserialization from RequestHandler to JsonApiParamEnhancer.
#12
Url::fromRouteis called with'related'to'related_field'. The parameter has always berelated, it's the controller that was using different naming since naming didn't matter.CONTROLLER_SERVICE_NAME, I think that's most accurate. I like having the constant vs. a string.Comment #17
gabesullice4 + 5 + 7 + some other clean ups.
For example, we need to name
$entityto$parsed_entityso the name is the same forcreateIndividualandpatchIndividualComment #22
gabesulliceFixes the CS violation. I also forgot one route name change which caused the test failure.
Comment #24
gabesulliceReroll.
Comment #26
wim leers#16.2: Ahh, that makes sense. Too bad 😞
No further remarks. RTBC when the blocker lands!
For now, marking postponed.
Comment #27
gabesulliceRerolled.
Comment #28
wim leersRebased #27 on top of not only #2987608: Move deserialization from RequestHandler to JsonApiParamEnhancer but also #2958554: Allow creation of file entities from binary data via JSON API requests, because #2958554 changes some things in
EntityResourcethat conflict with some of the changes here. This is just for testing purposes in #2958554.Comment #29
wim leers#2987608: Move deserialization from RequestHandler to JsonApiParamEnhancer just landed!
Needs work because of #27's failures.
Comment #30
gabesulliceIt looks like a few
$related_field -> $relatedchanges got missed in the reroll (see #5 and #16.2 for a reminder about why those changes are necessary).Comment #31
gabesulliceBack to RTBC per #26
Comment #38
wim leers👌
P.S.: I love the smell of a lovely diffstat in the morning:
11 files changed, 97 insertions(+), 184 deletions(-)😍Comment #40
wim leersd.o is again suffering from a race condition; in some places this is marked as , in others it's marked as RTBC. Let's fix that changing the status twice.
Comment #41
wim leers