richhollis / swagger-docs

Generates swagger-ui json files for Rails APIs with a simple DSL.
MIT License
749 stars 150 forks source link

param :path, not showing up. #170

Closed imnithin closed 7 years ago

imnithin commented 7 years ago

'rails' 5.1.1

Gemfile.


  gem 'swagger-docs'
  gem 'grape-swagger-rails'

Gemlock

    swagger-docs (0.2.9)
    grape-swagger-rails (0.3.0)

in controller


  swagger_api :show do
    summary "Display plan"
    param :path, :id, :integer, :required, "Plan Id"
    response :not_found
  end

.json file

{
  "apiVersion": "1.0",
  "swaggerVersion": "1.2",
  "basePath": "http://localhost:3000",
  "resourcePath": "plans",
  "apis": [
    {
      "path": "/api/v1/plans",
      "operations": [
        {
          "summary": "Display plan",
          "parameters": [

          ],
          "responseMessages": [
            {
              "code": 404,
              "responseModel": null,
              "message": "Not Found"
            }
          ],
          "nickname": "Api::V1::Plans#show",
          "method": "get"
        }
      ]
    },

I would be happy to share further details. If needed

imnithin commented 7 years ago

I'm sorry , the routes had a issue.