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

Fix: translate parameter type to String, enables integration with things like Mongoid. #46

Closed
wants to merge 4 commits into from

Conversation

dblock
Copy link
Member

@dblock dblock commented Jun 25, 2013

Mongoid defines something called a field that has a definition, including a type. That will be a class, such as Boolean. Grape-swagger builds a hash that includes type: Boolean. If you serialize this with JSON, it will recursively call as_json, and if you call Boolean.to_json you don't get a String, "Boolean", but you get a hash, {}. This breaks everything. Aside of fixing the problem, I think it's a good idea to force the type to always be a string, to avoid any hard to debug nested behavior.

@tim-vandecasteele
Copy link
Contributor

Merged, thanks.

@dblock dblock deleted the parameter-type branch July 21, 2014 23:07
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

Successfully merging this pull request may close these issues.

2 participants