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

example provided with documentation ignored for type of boolean #45

Closed
drewnichols opened this issue May 13, 2020 · 2 comments
Closed

Comments

@drewnichols
Copy link
Contributor

I have an entity defined as follows which provides and example value of false

module Entities
  class OrderEntity < Grape::Entity
    expose :pre_order,
           documentation: {
             type: Grape::API::Boolean,
             desc: 'true, if this order is a pre-order, otherwise false.',
             example: false
           }
  end
end

When the swagger file is generated it seems to be ignoring the example and returns nothing.

"OrderEntity": {
  "type": "object",
  "properties": {
    "pre_order": {
      "type": "boolean",
      "description": "true, if this order is a pre-order, otherwise false."
    }
  }
}

I should note that if I change the example to a string of "false" it does return the string correctly.

@drewnichols
Copy link
Contributor Author

drewnichols commented May 13, 2020

After fixing this I noticed that when we provide a default value in the documentation of false it suffers from the same problem

@kzaitsev
Copy link
Collaborator

Hello, grape-swagger-entity 0.4.0 was released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants