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

Include documented Hashes #454

Merged
merged 7 commits into from
Jun 14, 2016
Merged

Include documented Hashes #454

merged 7 commits into from
Jun 14, 2016

Conversation

aschuster3
Copy link
Contributor

This is opened to address Issue #445 and is a reopen of PR #453

Because of the way the logic is stated, raw Hashes can never be included. After digging through, I found that the reason this exists in the first place is because Hashes and Arrays are replaced with their object references when possible (e.g. "address"=>{"$ref"=>"#/definitions/someDefinition"} is preferred over "address"=>{"type"=>"object"}).

Another addition to this PR that was relevant to the original problem is that readOnly parameters are included in a request definition generated by the MoveParams class. Open API v2 spec says to exclude readOnly parameters in request objects and seeing as the purpose of MoveParams is to generate a helper request definition, I removed the addition of readOnly parameters. This specifically addresses redundant path parameters in the JSON block.

Because the problems both of these features are closely related, I felt that the scope of this PR encompasses both changes.

@LeFnord
Copy link
Member

LeFnord commented Jun 14, 2016

👍 … awesome :)

@dblock
Copy link
Member

dblock commented Jun 14, 2016

Excellent work @aschuster3.

@dblock dblock merged commit 611572f into ruby-grape:master Jun 14, 2016
LeFnord pushed a commit to LeFnord/grape-swagger that referenced this pull request Feb 9, 2019
* Fix logic for mapping Hash and Array objects to refs

* Add tests to account for documented Hashes and Arrays

* Do not include readOnly params in request definitions

* Test for new documentation behavior

* Update changelog [ci skip]

* Use respond_to? instead of try for earlier compliance

* Use proper url for changelog
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.

3 participants