Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Hello,
I created a RestResource plugin that exposes some data in JSON format. The problem I'm having is that when I access the defined URL for that plugin, I also have to specify the "_format=json" parameter.
Is there a way to alter the default '_format' so that it's json, instead of html, so I can ommit passing it in the URL?
Issue fork drupal-2821701
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dawehner#2831137: Remove the need for ?_format=api_json: assume the use of the 'api_json' format for routes managed by JSON API kinda wants to achieve the same kind of stuff.
Comment #4
Wim LeersThanks for pointing to this issue, @dawehner!
Comment #5
Wim LeersThis was filed against the routing system component and was hence not discovered until now. Somebody just created #2852587: Allow REST resource config entities to specify a default format and included a patch. So closing this in favor of that.