Parsoid's v2 API is gratuitously different from the RESTbase API in some minor ways. These should be fixed so that mediawiki-core doesn't continue to have to do silly transformations between URL schemes and results. In order to ease migration, this should probably be done as a new Parsoid "v3" API, after which we can deprecate and remove support for Parsoid's "v1" and "v2" APIs (T100681).
Changes to make:
- the "body" parameter to the wt2html end point should be renamed "bodyOnly"
- the "wt" format should be renamed "wikitext"
- The result of the html2wt endpoint should be wikitext content (like in Parsoid's v1 API and RESTBase), not a JSON wrapper around the same.
- When bodyOnly is true, we should serialize the *children* of the <body> element, not the <body> element itself.
- We should consider supporting the /transform/X/to/Y route as an alias of the /Y route.
- RESTBase uses /page/$format/ instead of just $format/ for GETs.
We should also consider reordering the version and the hostname, since we have:
https://$wgServerName/api/rest_v1/page/html/{TITLE} [VirtualRESTService]
http://parsoid-lb.eqiad.wikimedia.org/v2/$wgServerName/html/{TITLE} [Parsoid v2]
http://rest.wikimedia.org/$wgServerName/v1/page/html/{TITLE} [RESTbase v1]