ruby-grape / ruby-grape/grape-swagger

Does not autogenerates after changing entity

Open
#857 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

Sorry guys, maybe I missed something important in the docs.

As I understood I should just add gem to a Gemfile, then add add_swagger_documentation method to my API class which is Grape::API inherited, and then MAGIC, it should autogenerate swagger.json file.

I've received legacy project with grape-swagger, grape-swagger-representable, grape-swagger-representable and rswag-ui gems and configuration.

Everything works fine until I change entities.

swagger.json is without any changes...

I didn't find how can I regenerated this file.

Could you please tell me, what should I do to get swagger.json updated.

class API::V4 < Grape::API
  # ...
   add_swagger_documentation(
      base_path: '/api',
      api_version: 'v4',
      hide_documentation_path: true,  
      doc_version: '4',
      api_key: 'something:something',
      mount_path: '/swagger_doc',
      security_definitions: {
           Authorization: {
               type: 'apiKey',
               name: 'Authorization',      
               in: 'header'
           }
       }
  )
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

Read the Gemfile and the API::V4 add_swagger_documentation entry point, then determine how swagger.json is generated and whether entity changes are reflected automatically. Document the exact regeneration workflow and clarify what users should do to update the file.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.