happycar/zf2-swagger-ui

This package is abandoned and no longer maintained. No replacement package was suggested.

ZF2 - Swagger UI Module

v1.0.1 2016-06-16 07:38 UTC

This package is not auto-updated.

Last update: 2020-08-14 01:43:18 UTC


README

License Total Downloads Latest Stable Version Latest Unstable Version

ZF2 module wrapping the default Swagger-UI in a ZF2 module.

Installation

The recommended way to install happycar/zf2-swagger-ui is through composer by adding the dependency to your composer.json:

{
    "require": {
        "happycar/zf2-swagger-ui": "*"
    }
}

This module needs some configurations which can just defined by the root project:

Therefore please add the following configurations to your composer.json as well

{
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "swagger-api/swagger-ui",
                "version": "2.1.4",
                "source": {
                    "url": "https://github.com/swagger-api/swagger-ui",
                    "type": "git",
                    "reference": "v2.1.4"
                }
            }
        }
    ]
}
{
    "scripts": {
        "post-update-cmd": [
            "cp -R ./vendor/swagger-api/swagger-ui/dist ./vendor/happycar/zf2-swagger-ui/public/swagger-ui",
            "cp ./vendor/swagger-api/swagger-ui/dist/index.html ./vendor/happycar/zf2-swagger-ui/view/swagger-ui/index/index.phtml",
            "sed -i -e 's,images/,/swagger-ui/images/,g' ./vendor/happycar/zf2-swagger-ui/view/swagger-ui/index/index.phtml",
            "sed -i -e 's,css/,/swagger-ui/css/,g' ./vendor/happycar/zf2-swagger-ui/view/swagger-ui/index/index.phtml",
            "sed -i -e 's,lib/,/swagger-ui/lib/,g' ./vendor/happycar/zf2-swagger-ui/view/swagger-ui/index/index.phtml",
            "sed -i -e 's,swagger-ui.js,/swagger-ui/swagger-ui.js,g' ./vendor/happycar/zf2-swagger-ui/view/swagger-ui/index/index.phtml"
        ]
    }
}

Then add the module to the modules array in your application.config.php by adding "SwaggerUI".

Usage

After adding the module to your application config you can access Swagger UI by going to /api.

How to Improve It

Create your own fork of happycar/zf2-swagger-ui

To share your changes, submit a pull request.

Change Log

Please see releases for change log.

License

The MIT License (MIT)

Copyright (c) 2016 HAPPYCAR GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.