Closed (duplicate)
Project:
Drupal core
Version:
8.0.x-dev
Component:
rest.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2015 at 17:18 UTC
Updated:
8 Feb 2016 at 15:17 UTC
Jump to comment: Most recent
Comments
Comment #2
dawehnerInteresting!!
Comment #3
imalabyaCan you try with the latest drupal-rc2 version. Followed the same steps and it is working fine. The JSON output is being displayed.
Comment #4
clemens.tolboom@malavya the frontpage must show HTML not JSON as we are not requesting json ... please recheck
Comment #5
imalabyaAhh.. sorry, my bad. Read it other way round. But to get the HTML out I suppose it needs to a HTML formatter in the serializer?
Comment #6
clemens.tolboom@malavya just visit the frontpage with your browser :p then you should see HTML not JSON
Comment #7
dawehnerThe problem is the following line of code:
As you see, HTML is always added to the allowed formats, as we thought at some point its a good idea to have those sites be accessible via the browser.
Maybe we should better decide that this is a bad idea in the first place ...
Comment #8
clemens.tolboomI was puzzled with the _format=html not throwing an exception related to #2594777: Accessing a non existing format results in a 500
Why should I allow non-compliant systems to get my view? I want Drupal to throw an exception so my site bug are not contaminated with html-rest related issues.
So yeah .... let's remove that auto _format if possible. Or make it configurable thus explicit.
Comment #9
dawehnerWell, I don't have the energy to fight this (probably hopeless) battle with webchick, but feel free to do so.
Comment #10
clemens.tolboomHuh ... extra info: webchick was on favor of this obscured auto html?
Do you have some more info or should I just write the simple 'removal' patch then see what happens?
Comment #11
dawehnerSee #1969870: REST export view should default to JSON
Comment #12
wim leersAFAICT this is a duplicate of #2449143: REST views specify HTML as a possible request format, so if there is a "regular" HTML view on the same path, it will serve JSON.