Closed (fixed)
Project:
JSON:API
Version:
8.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
28 Nov 2016 at 16:05 UTC
Updated:
18 Jan 2017 at 10:34 UTC
Jump to comment: Most recent, Most recent file
Drupal\jsonapi\Context, Drupal\jsonapi\Query and Drupal\jsonapi\Routing namespaces looks okay, precisely because it's only not exposing APIs, it's not interacting with key APIs: it's all just logic to support the JSON API spec. Which means it's exactly the kind of code that is likely to be refactored. Marking it @internal would signal to developers that they should not be extending or even interacting with these objects. They're implementation details, that can change at any time.
\Drupal\jsonapi\Relationship(Interface) and \Drupal\jsonapi\EntityCollection(Interface) not in a similar subnamespace?
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 2831187-15.patch | 21.5 KB | wim leers |
Comments
Comment #2
e0ipsoNormalizernamespace?Comment #3
e0ipsoComment #4
e0ipsoIs this what you meant @Wim Leers?
Comment #6
e0ipsoFixed tests.
Comment #7
wim leersLOL I wanted to apply your patch, only to then notice that I already rolled a patch myself that I forgot to upload. Dammit!
This is what I had locally.
Comment #8
wim leersIgnore #7, I just uploaded that for completeness.
Reviewed #6. Yes, that's exactly what I meant :)
Just one thing:
I think these classes would benefit from a comment explaining their purpose, just like you did here in #2.2.
Comment #10
wim leers#8 would be nice to have happen, but in the mean time, #6 is still a step forward.
Comment #11
wim leersThe patch here no longer applies. Rerolling…
Comment #12
wim leersStraight reroll of @e0ipso's patch in #6. Conflicted with #2831185: Rename DocumentWrapper to JsonApiDocumentTopLevel and DocumentRootNormalizer to JsonApiDocumentTopLevelNormalizer.
Comment #14
wim leersMade one small mistake in rebasing.
Comment #15
wim leersNow I addressed my own feedback in #8: I added the explanation you posted in #2.2 to the code docs.
However, upon doing so, I noticed that the documentation lives on
Relationship, i.e. the implementation, not the interface. So I did the same forEntityCollection.I think it's clear that in this case, having interfaces is pointless: there will NEVER BE multiple implementations. These are value objects used only in JSON API's normalization process. So it's fine to NOT have interfaces. Doing that is out of scope of this issue though, I think. So not doing that just yet.
I think this patch is ready again! I only rebased it, and added e0ipso's comments from #2.2. I think it's fine for me to re-RTBC this.
Comment #17
e0ipsoI did a small re-roll during the merge. This is fixed now.
Comment #18
wim leersNext step: #2840948: Remove interfaces of JSON API-specific normalizers.