Skip to content

fkiene/jsonapi-swagger

This branch is 19 commits ahead of, 3 commits behind superiorlu/jsonapi-swagger:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 19, 2020
340b0d4 · Aug 19, 2020

History

59 Commits
Aug 26, 2019
Apr 18, 2019
Aug 19, 2020
Apr 18, 2019
Apr 18, 2019
May 1, 2019
Aug 19, 2020
Apr 18, 2019
Mar 11, 2020

Repository files navigation

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'
  # underscored, camelized, dasherized, or custom
  config.attribute_format = 'dasherized'
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.

About

Create a JSONAPI Swagger.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 71.4%
  • Ruby 28.3%
  • Shell 0.3%