grape-entity
grape-entity copied to clipboard
An API focused facade that sits on top of an object model.
Hi there! Thanks for the great gem. I like it a lot. I'm new to Grape, so maybe I'm missing something. When using a custom entity with `present_collection true` the...
I updated to Ruby 2.4.1 and grape-entity started complaining about using a lambda with `:if`. This worked perfectly on Ruby 2.4.0, grape 0.19.2 and grape-entity 0.6.1: ```ruby expose :context_company_id, if:...
Hi folks. Given the following entity: ```ruby expose :name expose :address expose :street, safe: true do |instance, _| instance.address.street end end ``` If `address` is `nil`, `safe: true` is supposed...
**app/api/mysite/entities/v1/order.rb** ``` module Mysite module Entities class V1::Order < Mysite::Entities::Base expose :id expose :state expose :cost expose :supplier, using: "Mysite::Entities::V1::Supplier" expose :office, using: "Mysite::Entities::V1::TheOffice", as: :customer expose :order_product_memberships, using: "Mysite::Entities::V1::OrderProductMembership",...
I want to have multiple classes inside grape entity file, this is the folder structure app/api/proj/api/v2/entities/committee.rb module PROJ::API::V2::Entities class Committee < Grape::Entity expose :id expose :name, :full_name, :email, :tag, :parent_id...
```ruby class Entity < Grape::Entity expose :car, documentation: { type: String, values: ["foo", "bar"] } end ``` And then use it as validation with ```ruby params do requires :all, using:...
When using Grape, Grape Entity and Grape Swagger and I have an entity with a nested object. Should we have the ability to provide nested documentation if that object has...
hi my project model name is `TxhimsPatientInfo` ,but my databse table name is `patient_infos` ``` class TxhimsPatientInfo < TxhimsModel self.table_name = "patient_infos" end ``` entity name is `TxhimsPatientInfoEntity` ``` class...
I am wondering why I am getting a separate query for each attribute of my entity. For example, here I am asking for a `CustomerEntity` and it has more than...
I've got a project that was still running 0.4.8 where, for example, we have Arrival and Departure types of Flight records, and the consumer wanted fields labelled as such. Rather...