0.05
No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
JSON API Swagger Doc Generator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
>= 12.3.3
~> 2.0
~> 0.67
 Project Readme

JSONAPI Swagger

Generate JSONAPI Swagger Doc.

Gem Version GitHub license

jsonapi-swagger-4-2-9.gif

Installation

Add this line to your application's Gemfile:

gem 'jsonapi-swagger'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jsonapi-swagger

Usage

  1. config jsonapi swagger
# config/initializers/swagger.rb
Jsonapi::Swagger.config do |config|
  config.use_rswag = false
  config.version = '2.0'
  config.info = { title: 'API V1', version: 'V1'}
  config.file_path = 'v1/swagger.json'
end
  1. generate swagger.json
# gen swagger/v1/swagger.json
bundle exec rails generate jsonapi:swagger User # UserResource < JSONAPI::Resource
  1. additional

use rswag, have to run

# gen swagger/v1/swagger.json
 bundle exec rails rswag:specs:swaggerize

RoadMap

  • immutable resources
  • filter/sort resources
  • mutable resources
  • generate swagger.json without rswag

Resource

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/superiorlu/jsonapi-swagger.