Closed (fixed)
Project:
JSON:API
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
18 Jun 2016 at 18:42 UTC
Updated:
23 Jul 2016 at 15:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
e0ipsoThis is blocking #2751527: [FEATURE] Create entity level resources.
Comment #3
dawehner+1 for chosing /{entity_type_id}/{bundle}/{id}. If people care they could create aliases or so.
Comment #4
e0ipsoAdded patch.
I'm not sure how I feel about entities with a single bundle. I guess that I will have better visibility when I work on #2751527: [FEATURE] Create entity level resources.
Comment #5
e0ipsoNamespace the
typeas well.Comment #7
dawehnerLooks perfect for me. One thing we could discuss later is whether we want to treat entity types without bundles (like many config ones) in a special way.
Comment #8
dawehnerComment #9
e0ipsoThe problem I see is BC with the API when the 2nd bundle is introduced and the API already has some consumers implemented around the special single-bundle case. Is there an entity definition that does not accept bundles at all?
Comment #10
dawehnerGiven
\Drupal\Core\Entity\ContentEntityBase::bundleI'm wondering whether its safe to check whether the 'bundle' entity type exists.Comment #12
dremy commentedIt may be that the README.md needs to be updated or somethings not working, however when I navigate to a test article at:
None of these or any of the other illustrated paths work. This is using the most recent jsonapi dev download with all modules (serializiation, rest web services, and even restui) installed on a clean updated pantheon d8 build (8.1.7).
Instead I get messoges like:
Comment #13
e0ipso@dremy the README may need some love, it's outdated. Maybe you'll want to send a patch on that.
Unless you explicitly change that, you'll need to use the UUID instead of the entity ID. See https://www.youtube.com/watch?v=K58Zou9zA9o&list=PLZOQ_ZMpYrZsyO-3IstImK...
You can list the articles by going to
/api/node/article?_format=api_jsonand use the UUID, as shown in the video.Comment #14
dremy commentedYup. I'll create a new issue and update.