ruby-grape / ruby-grape/grape-swagger

Support for accept_version_header?

Open
#573 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I have:

class MyAPI < Grape::API
  version :v1, using: :accept_version_header, cascade: true
  ...

  add_swagger_documentation
end

When I go to http://localhost:3000/api/swagger, it wants to fetch its info from http://localhost:3000/api/v1/swagger_doc, which doesn't exist.

Is there a way to tell grape-swagger that I'm using accept_version_header?

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 MyAPI configuration with version :v1 using :accept_version_header and add_swagger_documentation, then inspect how the /api/swagger endpoint builds its /api/v1/swagger_doc URL. Confirm whether the generated documentation request can use the Accept version header, and verify that the resulting Swagger documentation endpoint works.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.