Coder Social home page Coder Social logo

elli-swagger's Introduction

elli-swagger

A swagger(๐Ÿ˜Ž) middleware for elli.

How To use?

This library was thought to be simple and easy to use.

1. Configure your application, which can be accomplisehd by adding

    [
        ...
        {elli_swagger, [{
            swagger_metadata, #{openapi => <<"3.0.0">>,
                                info => #{title => <<"Doc Tile">>}},
            {elli_swagger_documentation_callback, you_callback_module}
        }]}
        ...
    ].

to your configuration file. 2. Add elli_swagger to your rebar.config so it can be loaded. If you want it to be loaded on a release:

    {relx, [{release, {elli_swagger_example, vsn}},[your_application,
                                                    elli,
                                                    {elli_swagger, load}]]}
     ...

3. You must specify that you want to copy the swagger folder inside _build/default/lib/elli_swagger in your rebar.config. To do that you just need to

4. Everything is ready now and you just need to call elli_swagger:start/2.

    elli_swagger:start([{your_module, your_args}], port_number)

How to document?

As you have probably noticed, one of the configuration variable is called elli_swagger_documentation_callback.

Setting the documentation in the same file as your code is a clever move, as it might boost readibility, however you might want to put the documentation callback on another module (which is fine) and in that case you can set that callback to be anything you want.

Please have in mind that this library is under development, and if you want for not setting a callback is not supported. Please always set the configuration properly (as in last section).

Contributions

Feel free to contribute to this project with opening an issue or opening a pull request!

License

MIT

elli-swagger's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.