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

How do I set the description of a grape entity model? #57

Open
sharkey11 opened this issue Nov 2, 2022 · 2 comments
Open

How do I set the description of a grape entity model? #57

sharkey11 opened this issue Nov 2, 2022 · 2 comments
Labels

Comments

@sharkey11
Copy link

Right now, the description of the model is automatically written as "{MODEL_NAME} Model" and put in the swagger docs. How do we override that?

@DataDaoDe
Copy link

DataDaoDe commented Jan 15, 2023

I would like to know this as well if anyone figures out how. I did figure out how to set the model name:

class MyNamedEntity < Grape::Entity
  def self.entity_name; 'MyNewName'; end
end

A full example can be found here: ruby-grape/grape-entity#121

This is nice b/c it lets you not have a lot of the namespace stuff in the name of your generated model types. Of course, this feels like a total hack to me rn. If anyone has a better way I'd be interested to know it too.

@dblock dblock added the question label Jul 6, 2023
@pirhoo
Copy link
Contributor

pirhoo commented May 17, 2024

The entity_name method is nice indeed but I think the question was more about a desc value in the model definition. I don't think that's currently doable.

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

4 participants