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

Does not support desc in entity type? #44

Open
run27017 opened this issue Apr 22, 2020 · 3 comments
Open

Does not support desc in entity type? #44

run27017 opened this issue Apr 22, 2020 · 3 comments
Labels

Comments

@run27017
Copy link

versions:

  • grape (1.3.0)
  • grape-entity (0.7.1)
  • grape-swagger (1.0.0)
  • grape-swagger-entity (0.3.4)

In below 1x1 relation, I set an desc 'Address...' in address field, but it doesn't render the desc in swagger-ui.

  module Entities
    class Client < Grape::Entity
      expose :name, documentation: { type: 'string', desc: 'Name' }
      expose :address, using: Entities::Address,
        documentation: { type: 'Entities::Address', desc: 'Address...', param_type: 'body', is_array: false }
    end

    class Address < Grape::Entity
      expose :street, documentation: { type: 'string', desc: 'Street' }
    end
  end

image

However, if I set the field as an array, it will render it.

      expose :address, using: Entities::Address,
        documentation: { type: 'Entities::Address', desc: 'Addresses...', param_type: 'body', is_array: true }

image

@kzaitsev
Copy link
Collaborator

Hello, did you try to use description instead of desc?

@run27017
Copy link
Author

run27017 commented Apr 22, 2020

@Bugagazavr description doesn't work at all regardless of whether is_array is true or false:

 expose :address, using: Entities::Address,
        documentation: { type: 'Entities::Address', description: 'Addresses...', param_type: 'body', is_array: true }

@kzaitsev kzaitsev transferred this issue from ruby-grape/grape-swagger Apr 22, 2020
@kzaitsev
Copy link
Collaborator

Ok, I will try to look into this and fix it.

@kzaitsev kzaitsev added the bug? label Apr 22, 2020
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

2 participants