ruby-grape / ruby-grape/grape-swagger

Think about add the desc options 'consumes' or 'produces' to add_swagger_documentation?

Open
#677 2 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

Can you add the API desc options 'consumes' or 'produces' to add_swagger_documentation?
So that I don't need to add option 'consumes' to every API desc.
desc 'Retrieve Authentication Token', consumes: ['application/x-www-form-urlencoded'] params do requires :code, type: String end post 'token' do ..... end

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 locating add_swagger_documentation and how it handles API description options. Trace how consumes and produces are currently read from individual desc declarations, then verify that the requested global options are reflected in the generated Swagger documentation without requiring each API description to repeat them.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, 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.