Drupal: 8.1.8

Pre-conditions:
- Enable Taxonomy term resource: cookie auth, json format

Steps:
1. Send Get request /taxonomy/term/1?_format=json

Actual:
Error response with httpCode 406 returned:
{
"message": "Not acceptable format: json"
}
Expected:
Success response with JSON representation of taxonomy term.

See also:
http://stackoverflow.com/questions/39250346/drupal8-rest-api-for-taxonom...

Thanks

Comments

vkepin created an issue. See original summary.

kylebrowning’s picture

Status: Active » Closed (cannot reproduce)

This is uhhh, a Drupal Core issue, not a Services issue.

If you're using services your url would have an API endpoint on it.

vkepin’s picture

Hi, kylebrowning

What do mean by

If you're using services your url would have an API endpoint on it.

?
For example, similar request for node GET http://mysite.com/node/1?_format=json passed successfully, and returned proper json response.

vkepin’s picture

Status: Closed (cannot reproduce) » Active
vkepin’s picture

Hi, kylebrowning

What do mean by

If you're using services your url would have an API endpoint on it.

?
For example, similar request for node GET http://mysite.com/node/1?_format=json passed successfully, and returned proper json response.

Thanks

kylebrowning’s picture

Status: Active » Closed (cannot reproduce)
dddave’s picture

Sorry, Mollom swallowed a bunch of posts by vkepin.

kylebrowning’s picture

The API calls you are making refer to Drupal's Core REST, not Services.

The issue you are having is with Drupal core, not, services.

id.tarzanych’s picture

Project: Services » Drupal core
Version: 8.x-4.x-dev » 8.2.x-dev
Component: Code » rest.module
Status: Closed (cannot reproduce) » Active

Not working on 8.x-2.x too

id.tarzanych’s picture

Everything works for nodes, but taxonomy term entities cannot be handled with RESTful web services

wim leers’s picture

Category: Bug report » Support request
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)
Issue tags: -REST API, -taxonomy

Please export your rest.resource.entity.taxonomy_term configuration and post it here.

id.tarzanych’s picture

uuid: a25c7fda-70ae-45d7-901a-13a6668a19c4
langcode: en
status: true
dependencies:
  module:
    - basic_auth
    - hal
    - serialization
    - taxonomy
id: entity.taxonomy_term
plugin_id: 'entity:taxonomy_term'
granularity: resource
configuration:
  methods:
    - GET
    - POST
    - PATCH
  formats:
    - json
    - hal_json
  authentication:
    - basic_auth
  GET:
    supported_formats:
      - hal_json
      - json
    supported_auth:
      - basic_auth
      - cookie
  POST:
    supported_formats:
      - hal_json
      - json
    supported_auth:
      - basic_auth
      - cookie
  PATCH:
    supported_formats:
      - hal_json
      - json
    supported_auth:
      - basic_auth
      - cookie

The issue is that application/json requests cannot pass \Drupal\Core\EventSubscriber\AcceptNegotiation406::onViewDetect406()

$event->getController()

returns controller from Views module instead of REST

wim leers’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)
Issue tags: +VDC
Related issues: +#2772537: REST Views override existing REST GET routes

Oh, this is just another duplicate of #2772537: REST Views override existing REST GET routes. Please follow that issue and help testing the patch there!

wim leers’s picture

And thanks for the fast reply!