Extension:SwaggerDoc

Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:MIT licensed extensions
MediaWiki extensions manual
SwaggerDoc
Release status: stableCategory:Stable extensions
Implementation Tag Category:Tag extensions
Description The SwaggerDoc extension provides swagger ui frontend for any swagger specification
Author(s) Urfiner (Nikolai Kochkin)
Latest version 0.1.0
MediaWiki 1.25+Category:Extensions with manual MediaWiki version
License MIT License
Download Category:Extensions in GitHub version control
Category:All extensionsCategory:Extensions not in ExtensionJson

The SwaggerDoc extension provides a UI frontend for any Swagger specification.

It is helpful for some enterprise MediaWiki sites to be able to document different APIs. In simple case you may want to just insert a Swagger doc instead of spending a lot of time on some documentation. The extension allows you to just insert a swagger UI into a page.

Usage

To use it, you need to

  • Create a page (for example, MySwaggerJsonSpec page) with swagger spec (JSON file). You may also want to change the content model to JSON but that is not mandatory
    • Alternatively, you can upload a file with your spec and specify its full path
  • Insert a SwaggerDoc tag with either specUrl or specUrls argument on another page:
<SwaggerDoc specUrls="[{'url': 'http://MyWiki/index.php/MySwaggerJsonSpec?action=raw', 'name': 'My swagger spec'}]" />
<SwaggerDoc specUrl="http://MyWiki/index.php/MySwaggerJsonSpec?action=raw" />
URL should be a link to the raw JSON (not to a page containing it); typically that is achievable by adding ?action=raw to the URL
  • Save the page and refresh it. You will see the swagger UI builtin in your page:

Installation and configuration

The extension has been tested on 1.41. It should work on MediaWiki 1.25+. The used hooks and manifest features are quite old.

To install the extension:

  1. Clone the repository to your extensions/ subfolder: git clone https://github.com/Griboedow/SwaggerDoc.git
  2. Load the extension in your LocalSettings.php: wfLoadExtension( 'SwaggerDoc' );

Done!

Category:All extensions Category:Extensions in GitHub version control Category:Extensions not in ExtensionJson Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:Extensions without an image Category:MIT licensed extensions Category:ParserFirstCallInit extensions Category:Stable extensions Category:Tag extensions