-
Notifications
You must be signed in to change notification settings - Fork 476
swagger v2 tag feature implemented #344
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
Closed
claymodel
wants to merge
15
commits into
ruby-grape:swagger-2.0
from
plathome:feature/swagger_v2_namespace_tagging
Closed
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
143c881
swagger v2 tag feature implemented
81dd6d7
updated the spec and groups
923b962
update for build pass
962c085
build update
567da3f
prefix remove for grouping and spec updated
dc6d254
code updated for options[:tareget_class] to grap the tag information
claymodel 9188aaf
update the prefix check
claymodel 1dfeff7
updated spec
claymodel 5f36c97
update
claymodel 84cd083
experiment
claymodel daad148
check
claymodel 4976d63
check
claymodel 08f718b
update check
claymodel 95a3628
regular expression fixed for checking the version from the path
claymodel 8944349
change in the tag information for the grouping json tagged output
claymodel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,5 @@ swagger_spec1.2/ | |
ToDo.md | ||
.ruby-version | ||
spec/params_entity_spec.rb | ||
vendor/bundle | ||
.bundle/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,14 +28,15 @@ def content_types_for(target_class) | |
# swagger spec2.0 related parts | ||
# | ||
# required keys for SwaggerObject | ||
def swagger_object(info, target_class, request, options) | ||
def swagger_object(info, target_class, request, options, namespace_routes_array) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why wound't the |
||
{ | ||
info: info, | ||
swagger: '2.0', | ||
produces: content_types_for(target_class), | ||
authorizations: options[:authorizations], | ||
host: request.env['HTTP_HOST'] || options[:host], | ||
basePath: request.env['SCRIPT_NAME'] || options[:base_path], | ||
tags: namespace_routes_array, | ||
schemes: options[:scheme] | ||
}.delete_if { |_, value| value.blank? } | ||
end | ||
|
@@ -132,6 +133,7 @@ def method_object(route, options) | |
methods[:produces] = produces_object(route, options) | ||
|
||
methods[:parameters] = params_object(route) | ||
methods[:tags] = Array(route.route_path.split('{')[0].split('/').delete_if { |i| (i==route.route_prefix) || i[/v[0-9]*/] }.reject(&:empty?).first) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be refactored out. |
||
methods[:responses] = response_object(route) | ||
|
||
if route.route_aws | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to refactor the whole
description
logic out of here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Daniel, Thank you for the feedback.
#348
I have updated the code and the build is passing now.
looking forward for your feed back.