Mattflaschen has uploaded a new change for review.

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


Change subject: Support jsonfm (pretty JSON formatted with HTML).
......................................................................

Support jsonfm (pretty JSON formatted with HTML).

Change-Id: I26e99e56024262d964868e8d6b3721579dba6cfb
---
M includes/ApiJsonSchema.php
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EventLogging 
refs/changes/52/69452/1

diff --git a/includes/ApiJsonSchema.php b/includes/ApiJsonSchema.php
index 7262aee..e477eb5 100644
--- a/includes/ApiJsonSchema.php
+++ b/includes/ApiJsonSchema.php
@@ -22,7 +22,14 @@
         * @return ApiFormatJson
         */
        public function getCustomPrinter() {
-               return $this->getMain()->createPrinterByName( 'json' );
+               $format = $this->getMain()->getVal( 'format' );
+               if ( $format === 'jsonfm' ) {
+                       // Handle 'jsonfm' normally
+                       return null;
+               } else {
+                       // Everything else is 'json'
+                       return $this->getMain()->createPrinterByName( 'json' );
+               }
        }
 
        public function getAllowedParams() {

-- 
To view, visit https://gerrit.wikimedia.org/r/69452
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26e99e56024262d964868e8d6b3721579dba6cfb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EventLogging
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to