ruby-grape / ruby-grape/grape-swagger
Documentation says default format is :json, but it responds differently when it's explicitly specified
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 1.1k
- Forks
- 479
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
When I have this:
add_swagger_documentation api_version: 'v1', mount_path: '/api_docs'
$ curl url/api_docs
I get a ruby hash string.
$ curl url/api_docs.json
I get a json document
add_swagger_documentation api_version: 'v1', mount_path: '/api_docs', format: :json
$ curl url/api_docs
I get a json document
$ curl url/api_docs.json
I get 404
The documentation claims that the first should be identical to the second (that is the meaning of a default).
And of course, the documentation claims the response format will be json by default, but I got a ruby hash in a string.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the two curl cases for add_swagger_documentation with and without format: :json, then trace the add_swagger_documentation entry point that handles format and mount_path. Compare the observed routes and response formats with the documentation; done means the documented default behavior and both endpoint responses agree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100