ruby-grape / ruby-grape/grape-swagger

Problem with nested resource in swagger ui

Open
#640 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1.1k
Forks
479
Avg merge
2d 14h
Merged PRs (30d)
6

Description

Hi, I'm working with

  • grape-roar (0.3.0)
  • grape-swagger (0.27.3)
  • grape-swagger-rails (0.3.0)

I'm trying to make a resource that belongs to both kind of users, admin and normal user.
Routes for admin contains ‘api/v1/admin/' and for normal users routes contains ‘api/v1/‘.
When i try to use nested: false option the UI doesn't change.

The resource that belongs to both kinds of users is called category (in my system) and it is the resource under admin that i'm trying to use as nested false: option. As you can see bellow.

namespace :admin do
resource :categories, swagger: {nested: false} do
end
end

But even using nested as false the swagger UI doesn't change, even if i try to use the nickname option.

Could someone help me with this issue?

Thanks in advance

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the admin categories route with grape-roar 0.3.0, grape-swagger 0.27.3, and grape-swagger-rails 0.3.0, using swagger: {nested: false} and the nickname option. Inspect the generated Swagger UI and compare it with the route configuration; the issue is done when the requested nesting behavior is reflected in the UI or the limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.