Update to reflect new JSON models

This commit is contained in:
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
key :description, 'Returns modules matching keywords with appropriate metadata.'
schema do
key :type, :array
items do
key :'$ref', :Module
property :data do
key :type, :array
items do
key :'$ref', :Module
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

View File

@ -20,9 +20,9 @@ module ModuleSearchServlet
begin
sanitized_params = sanitize_params(params)
data = Msf::WebServices.search_modules(sanitized_params)
set_json_response(data)
set_json_data_response(response: data)
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