-
Notifications
You must be signed in to change notification settings - Fork 1
/
restler_experiment.rb
31 lines (27 loc) · 994 Bytes
/
restler_experiment.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'json'
seeds = ['incident_response.json', 'payment.json', 'project_management.json']
spec_issues = ['invalid_examples']
api_issues = ['invalid_payload', 'unexpected_payload_root_node', 'payload_missing_keys', 'payload_extra_keys',
'payload_wrong_data_types', 'broken_record_deletion']
configs = []
seeds.each do |s|
configs << {
oas_seed_abs_path: "/SOME_PATH/#{s}",
mock_api_server_url: 'http://localhost:3000',
spec_issues: spec_issues,
api_issues: [],
generated_files_basename: "#{s.split('.').first}_#{spec_issues.first}"
}
api_issues.each do |api_issue|
configs << {
oas_seed_abs_path: "/SOME_PATH/#{s}",
mock_api_server_url: 'http://localhost:3000',
spec_issues: [],
api_issues: [api_issue],
generated_files_basename: "#{s.split('.').first}_#{api_issue}"
}
end
end
configs.each do |config|
File.write("restler_experiment/config/#{config[:generated_files_basename]}.config.json", JSON.generate(config))
end