LoginSignup
8
8

More than 5 years have passed since last update.

Grape Swaggerでドキュメントが表示されない問題

Posted at

https://github.com/tim-vandecasteele/grape-swagger
swagger_docがNot Foundだったり一部APIが表示されなかったりいくつかハマったのでメモ。

バージョン指定してる時

add_swagger_documentation api_version: "v1"

ベースURLを変更してる時

add_swagger_documentation base_path:"/api"

パラメータ付きのAPIしか表示されない時

  • grapeのコードのresource "***" 以下にもformatを指定する。
  • もっと良い方法があるのかも。
  class API < Grape::API
    format :json
    ...
    ...
    resource "aaa" do
      format :json
    ...
    ...
    resource "bbb" do
      format :json
    ...
    ...

8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8