Page MenuHomePhabricator

"json" type indicator in URL patterns
Closed, DeclinedPublic

Description

@tstarling asked that we include an indicator for the result media type in the endpoints. I think that's fine. I'd suggest we append /json to the URL patterns, as follows:

/page/{title}/history/json
/revision/{id}/compare/{other}/json
/revision/{id}/json

There are other mechanisms for doing this; some APIs do ".json" as if there is a virtual JSON file on a server being shared. I think it's OK, too.

Event Timeline

eprodromou updated the task description. (Show Details)
WDoranWMF triaged this task as Medium priority.Sep 17 2019, 12:15 PM
tstarling closed this task as Declined.Sep 23 2019, 11:40 PM

This is not really what I was attempting to ask for, as I just discussed with @eprodromou. Everything is JSON, so /json is redundant. My concern is just about changing what's inside the JSON depending on the needs of the client, for example the three diff formats I described at T231580. I don't think there is a simple top-level solution for that, we just have to think about future use cases on some of these endpoints.