Extension:SwaggerDoc
Appearance
SwaggerDoc Release status: stable |
|
---|---|
Implementation | Tag |
Description | The SwaggerDoc extension provides swagger ui frontend for any swagger specification |
Author(s) | Urfiner |
Latest version | 0.1.0 |
MediaWiki | 1.25+ |
License | MIT License |
Download | GitHub: Note: |
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
[edit]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
- 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
[edit]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:
- Clone the repository to your extensions/ subfolder:
git clone https://github.com/Griboedow/SwaggerDoc.git
- Load the extension in your LocalSettings.php:
wfLoadExtension( 'SwaggerDoc' );
Done!