MediaWiki r86302 - Code Review

Jump to: navigation, search
Revision:r86301‎ | r86302 (on ViewVC)‎ | r86303 >
Date:11:42, 18 April 2011
Status:ok (Comments)
* (bug 28586) YAML: strings that are the same as boolean literals
* (bug 28591) Update/replace/supplement spyc (YAML parsing library)
* YAML API output is now 1.2 compliant, using JSON as the formatter

YAML 1.2 spec is a JSON subset - "The primary objective of this revision is to bring YAML into compliance with JSON as an official subset. YAML 1.2 is compatible with 1.1 for most practical applications - this is a minor revision." [1] Per discussion with Tim, switch YAML to use the JSON formatter

Was originally going to delete the ApiFormatYaml per Tim, but class needed to keep nicer (and apparent) output in API help page

Hence made subclass ApiFormatJson, minimal method overriding

spyc.php deleted from libs

Modified paths:

Diff [purge]

Loading diff…

Follow-up revisions

Rev.Commit summaryAuthorDate
r86303Revert unintended changes from r86302reedy12:00, 18 April 2011
r88161HipHop build fixes:...tstarling12:25, 15 May 2011
r96049Followup r96045, r96047...reedy21:47, 1 September 2011


#Comment by Brion VIBBER (talk | contribs)   17:31, 3 May 2011

s/subset/superset/ :) (any JSON document is a valid YAML document, allegedly)

#Comment by Brion VIBBER (talk | contribs)   17:40, 3 May 2011

Just a note -- there are differences in the output between the previous YAML outputter and the JSON outputter, but I think it's actually a bug in the old YAML generator. :)


      pageid: 15580374
      ns: 0


	"query": {
		"pages": {
			"15580374": {
				"pageid": 15580374,
				"ns": 0,

The YAML outputter incorrectly turned query.pages from a map into a vector array, probably because it saw integer keys but didn't actually vet them. (Ah PHP, your frankenstein hashmap+array construct strikes again!) It's possible that YAML-using clients that assumed the broken structure may not always work with the new, HOWEVER the new output will actually be the correct output structure. So that's probably good.

Status & tagging log

  • 11:18, 20 April 2011 Catrope (talk | contribs) changed the status of r86302 [removed: new added: ok]