Skip to content

Does not support desc in entity type? #44

Closed

Description

@run27017

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

Activity

  1. kzaitsev commented on Apr 22, 2020

    @kzaitsev
    Collaborator

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

  2. run27017 commented on Apr 22, 2020

    @run27017
    Author

    @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 }
  3. kzaitsev commented on Apr 22, 2020

    @kzaitsev
    Collaborator

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

  4. added a commit that references this issue on Jan 28, 2026
    aed31df
  5. added a commit that references this issue on Jun 9, 2026
    f5a0771
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions