Update to reflect new JSON models
parent
3e8efea57a
commit
58b3f63c1a
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue