Simplify build of discovery_paths in swagger_ui_controller

This commit is contained in:
richie 2016-06-29 17:04:03 -07:00
parent 7a01babe01
commit 1068e6c7a6

View File

@ -14,7 +14,7 @@ module SwaggerRails
@discovery_paths = Hash[
swagger_filenames.map do |filename|
[
"#{root_path.chomp('/')}#{filename.sub(swagger_root, '')}",
filename.sub(swagger_root, root_path),
load_json(filename)["info"]["title"]
]
end