Skip to content

Dynamic namespace problem #140

Open
Open
@mepatterson

Description

@mepatterson

This is a weird one that I'm having trouble debugging. If I do this:

namespace ':color' do
  resource :toys do
    desc "Get a list of toys, scoped by color"
    get '' do
      @toys = Toy.where(color: params[:color])
      @toys
    end
  end
end

The intent is to have endpoints like /red/toys.json and /blue/toys.json

These work perfectly.

... but apparently Swagger/Grape-Swagger cannot document that endpoint.

GET /swagger_doc/orders.json returns []

If I put any other endpoints inside that same ':color' dynamic namespace, it won't document any of those either, unless I remove the GET '' endpoint, in which case it will document the others fine. If I change it to GET 'list' it will document that fine, too, but I'd rather have it as '/' because adding 'list' is redundant.

Am I doing something wrong, or is this a problem in Grape-Swagger?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions