Sha256: f16d6ae8728f8f58dbc5eceedbb6dffde76fee1085a526c215125d78e0192ff1

Contents?: true

Size: 1.45 KB

Versions: 22

Compression:

Stored size: 1.45 KB

Contents

# Swagalicious

This gem is an implementation of https://github.com/rswag/rswag/blob/master/rswag-specs that does not rely on Rails. Most of the code is a blatant copy/paste from that repo, most of the credit goes to them.

Currenty it does not implement any API or UI. In the application that is using this gem, we are using https://github.com/Redocly/redoc that is accessed through a rack middleware.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'swagalicious'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install swagalicious

## Usage

Add the following to your `spec_helper.rb` or add a new `swagger_helper.rb`

```ruby
require 'swagalicious`

RSpec.configure do |c|
  c.swagger_root = "public/swagger_docs" # This is the relative path where the swagger docs will be output
  c.swagger_docs = {
    "path/to/swagger_doc.json" => {
      openapi:  "3.0.3",
      basePath: "/api/",
      version:  "v1",
      info:     {
        title: "Namespace for my API"
      },
      components: {
        securitySchemes: {
          apiKey: {
            type: :apiKey,
            name: "authorization",
            in:   :header,
          }
        }
      },
    }
  }
end
```



## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ehowe/swagalicious.


## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
swagalicious-2.0.0 README.md
swagalicious-1.1.2 README.md
swagalicious-1.1.1 README.md
swagalicious-1.1.0 README.md
swagalicious-1.0.0 README.md
swagalicious-0.5.3 README.md
swagalicious-0.5.2 README.md
swagalicious-0.5.1 README.md
swagalicious-0.5.0 README.md
swagalicious-0.4.9 README.md
swagalicious-0.4.8 README.md
swagalicious-0.4.7 README.md
swagalicious-0.4.6 README.md
swagalicious-0.4.5 README.md
swagalicious-0.4.4 README.md
swagalicious-0.4.3 README.md
swagalicious-0.4.2 README.md
swagalicious-0.4.1 README.md
swagalicious-0.4.0 README.md
swagalicious-0.3.1 README.md