Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The README should more clearly explain the purpose of this gem #58

Open
anothermh opened this issue Nov 29, 2022 · 1 comment
Open

The README should more clearly explain the purpose of this gem #58

anothermh opened this issue Nov 29, 2022 · 1 comment
Labels

Comments

@anothermh
Copy link

I've used Grape off-and-on since 2016 and I've almost always used this gem to help generate Swagger docs. I'm currently using it in a project and my team relies on it every day.

Someone asked me what the gem actually does and I wasn't sure. I said I think it does something to enrich the docs with information from the entities. I went to the README and it says:

A simple grape-swagger adapter to allow parse representers as response model

Removing it raises an exception when generating our docs and the exception references an entity so I dug into the generated docs and I think that it's generating the definitions key:

{
  "definitions": {
    "Api_V1_Entities_User": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        }
      }
    }
  }
}

And tying that definition to the response body for that path:

{
  "responses": {
    "200": {
      "description": "OK",
      "schema": {
        "type": "array",
        "items": {
          "$ref": "#/definitions/Api_V1_Entities_User"
        }
      }
    }
  }
}

I looked at the source to double-check but there were no comments anywhere. I'm sure that given enough time to parse the source code of this and of ruby-grape/grape-swagger and ruby-grape/grape-entity I could figure out what the gem does but it seems easier to ask the authors if they can give some more detail on it.

I'm happy to create a PR for an updated README with more information if someone can give a clearer explanation of what this gem does, specifically:

  1. The purpose of this gem is to ...
  2. Without this gem your Swagger docs will be ...
  3. With this gem your Swagger docs will be ...
  4. This gem is required if ...
  5. You should use this gem if ...

This information is probably spread out across a few different places like documentation from those other repos, issues from those repos, and discussions on the Google Group, but I think it would be helpful and more welcoming to new users to have the information in the README of this repo.

@kzaitsev
Copy link
Collaborator

@anothermh Hello, thank you, yes please send a PR.

@dblock dblock added the chore label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants