-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.html
88 lines (88 loc) · 4.41 KB
/
index.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset=utf-8 />
<title>cURL to Swagger</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<script src="garlic-standalone.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-2">
<h1>cURL to Swagger</h1>
<p>Paste curl command and response JSON</p>
<form data-persist="garlic">
<div class="row">
<div class="col-md-5">
<h3>cURL command</h3>
<textarea class="form-control" id="curl" name="curl" rows="3" placeholder="Paste cURL command. You can use generated string by Google Chrome DevTools!"></textarea>
<p>
<strong>Ignores:</strong>
<div class="checkbox">
<label>
<input type="checkbox" name="ignores[]" value="Accept" checked> Accept
</label>
<label>
<input type="checkbox" name="ignores[]" value="Accept-Encoding" checked> Accept-Encoding
</label>
<label>
<input type="checkbox" name="ignores[]" value="Accept-Language" checked> Accept-Language
</label>
<label>
<input type="checkbox" name="ignores[]" value="Cache-Control" checked> Cache-Control
</label>
<label>
<input type="checkbox" name="ignores[]" value="Connection" checked> Connection
</label>
<label>
<input type="checkbox" name="ignores[]" value="Origin" checked> Origin
</label>
<label>
<input type="checkbox" name="ignores[]" value="Pragma" checked> Pragma
</label>
<label>
<input type="checkbox" name="ignores[]" value="Referer" checked> Referer
</label>
<label>
<input type="checkbox" name="ignores[]" value="User-Agent" checked> User-Agent
</label>
<label>
<input type="checkbox" name="ignores[]" value="Content-Length" checked> Content-Length
</label>
<label>
<input type="checkbox" name="ignores[]" value="Content-Type" checked> Content-Type
</label>
</div>
<br />
<h3>Response JSON <button class="btn btn-xs btn-success btn-add">Add</button></h3>
<span class="help-block">Paste response JSON with HTTP status code.</span>
<div class="responses">
<div class="row">
<div class="col-md-12">
<input type="text" name="status_code[]" class="form-control" placeholder="HTTP Status code">
</div>
<div class="col-md-12">
<textarea name="response[]" class="form-control response" rows="3" placeholder='{"supports":["canvas","system","serviceinformation","notification","authorization","media_player","servicediscovery"],"result":0,"product":"Device Connect Manager","version":"2.0.0","connect":{}}'></textarea>
<button class="btn btn-warning btn-xs btn-delete">Delete</button>
</div>
</div>
</div>
<br />
<h3>Options</h3>
<span class="help-block">Customize YAML format. ex) response.error.message, request.query.message. Using YAML.</span>
<textarea class="form-control" id="options" name="options" rows="10" placeholder="test"></textarea>
</div>
<div class="col-md-5">
<h3>Swagger</h3>
<span class="help-block">Copy and use this YAML text with <a href="http://editor.swagger.io/#/" target="_blank">Swagger Editor.</a> <strong> Paste it under paths parameters. </strong> </span>
<textarea class="form-control" id="yaml" name="yaml" rows="36"></textarea>
</div>
</div>
</form>
</div>
</div>
</div>
</body>
</html>