Page MenuHomePhabricator

Math end point responses should set the content-type's profile
Closed, DeclinedPublic

Description

Mathoid responses contain the Content-Type header, but it doesn't have a versioned profile portion, e.g.:

content-type: image/svg+xml

Having a versioned profile would allow us to do automatic content upgrades and inform users better on what to expect to be present in the response, in same fashion as other end points already do:

content-type: text/html; charset=utf-8; profile="https://www.mediawiki.org/wiki/Specs/HTML/1.5.0"

In order to complete this task we need to:

  • Add profile to Mathoid's responses
  • Document the formats on wiki
  • Have RESTBase serve them and perform automatic upgrades when needed

Event Timeline

mobrovac created this task.

Change 370603 had a related patch set uploaded (by Physikerwelt; owner: Physikerwelt):
[mediawiki/services/mathoid@master] Update to MathJax-node 1.0

https://gerrit.wikimedia.org/r/370603

I have created the following documentation pages

These specs are meant to describe the output of REST API end points, so this isn't needed and should be removed.

and for the formats provided by mathoid/restbase

Since this is about the REST API output, the spec names shouldn't mention the extension; they should be moved to https://www.mediawiki.org/wiki/Specs/{format}/1.0.0.

I had the feeling that the profiles extend the definitions of the format standards. i.e. for instance, the SVG documentation page should provide further details on the SVG format generated by the RESTbase endpoint that is not already specified in the SVG spec. As long as the math endpoint is the only endpoint that generates SVG this works fine. However, if e.g. graphoid would generate SVG as well this would be conflicting and a developer would like to know if the server response is a graphoid or a mathoid SVG...

I had the feeling that the profiles extend the definitions of the format standards. i.e. for instance, the SVG documentation page should provide further details on the SVG format generated by the RESTbase endpoint that is not already specified in the SVG spec.

Yes, but that should be explicitly stated on the wiki page, Furthermore, it should document the specific aspects of the SVG spec used by the format that users/clients can expect.

As long as the math endpoint is the only endpoint that generates SVG this works fine. However, if e.g. graphoid would generate SVG as well this would be conflicting and a developer would like to know if the server response is a graphoid or a mathoid SVG...

The API is user-centric, so the specs should reflect that. If multiple end points serve the same format (with the same version), then (i) the conventions used by them should be more or less the same; and (ii) any specificities used by each of them should be documented on the same page (i.e. there should be a Math section and a Graph section, not Mathoid and Graphoid).

ok. I do understand the details of the idea now and moved the pages. Of course, the documentation is not yet written and will follow based on the needs of the actual endpoint users. I could not delete the HTML page, but I moved them to my userspace.

Change 370603 merged by Mobrovac:
[mediawiki/services/mathoid@master] Update to mathoid-mathjax-node 0.7

https://gerrit.wikimedia.org/r/370603

mobrovac updated the task description. (Show Details)
mobrovac removed a subscriber: Aklapper.