Update to reflect new JSON models

GSoC/Meterpreter_Web_Console
Erin Bleiweiss 2018-07-31 15:57:26 -05:00
parent 3e8efea57a
commit 58b3f63c1a
2 changed files with 15 additions and 5 deletions

View File

@ -158,12 +158,22 @@ module ModuleSearchApiDoc
response 200 do response 200 do
key :description, 'Returns modules matching keywords with appropriate metadata.' key :description, 'Returns modules matching keywords with appropriate metadata.'
schema do schema do
key :type, :array property :data do
items do key :type, :array
key :'$ref', :Module items do
key :'$ref', :Module
end
end end
end end
end end
response 500 do
key :description, 'An error occurred during the operation. See the message for more details.'
schema do
key :'$ref', :ErrorModel
end
end
end end
end end

View File

@ -20,9 +20,9 @@ module ModuleSearchServlet
begin begin
sanitized_params = sanitize_params(params) sanitized_params = sanitize_params(params)
data = Msf::WebServices.search_modules(sanitized_params) data = Msf::WebServices.search_modules(sanitized_params)
set_json_response(data) set_json_data_response(response: data)
rescue => e rescue => e
set_error_on_response(e) print_error_and_create_response(error: e, message: 'There was an error completing the module search:', code: 500)
end end
} }
end end