-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.html
129 lines (113 loc) · 5.64 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html>
<html lang="en">
<head>
<title>Mermade Swagger 2.0 to OpenAPI
<%= targetVersion %> converter</title>
<link rel="stylesheet" type="text/css" href="/css/smart-green.css" media="screen">
</head>
<body>
<a href="/api/v1/validate?url=/examples/openapi.json"><img style="position: absolute; top: 0; left: 0; padding: 5;" src="/api/v1/badge?url=/examples/openapi.json" alt="Petstore validation example"></a>
<a href="https://github.com/mermade/swagger2openapi"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/a6677b08c955af8400f44c6298f40e7d19cc5b2d/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677261795f3664366436642e706e67"
alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>
<div class="smart-green">
<h1>Mermade Swagger 2.0 to OpenAPI
<%= targetVersion %> converter</h1>
<h3>Conversion / Validation <a href="https://github.com/mermade/swagger2openapi">engine</a> v<%= s2oVersion %></h3>
<h3>Web <a href="https://github.com/mermade/openapi-webconverter">frontend</a> version v<%= self.version %></h3>
<div align="center">
<a href="https://github.com/Mermade/swagger2openapi"><img src="https://github.com/Mermade/oas-kit/raw/main/docs/logo.png?raw=true" alt="logo" height="150"></a>
</div>
<div class="tabs">
<div class="tab">
<input type="radio" id="tab-1" name="tab-group-1" checked>
<label class="tabLabel" for="tab-1">Convert</label>
<div class="content">
<form method="post" enctype="multipart/form-data" action="/api/v1/convert">
<label for="txtSource1">Paste Swagger 2.0 here:</label>
<textarea name="source" id="txtSource1" maxLength="150000" rows="7" cols="50"></textarea>
<label for="chkValidate1">Validate</label>
<input name="validate" id="chkValidate1" type="checkbox">
<p>
<button class="button" type="submit">Convert Swagger/OpenAPI 2.0</button>
</form>
<form method="post" enctype="multipart/form-data" action="/api/v1/convert">
<label for="file1">Or...</label>
<input id="file1" type="file" name="filename" accept="application/json,text/yaml,application/yaml">
<label for="chkValidate2">Validate</label>
<input name="validate" id="chkValidate2" type="checkbox">
<p>
<button class="button">Upload File</button>
</form>
</div>
</div>
<div class="tab">
<input type="radio" id="tab-2" name="tab-group-1">
<label class="tabLabel" for="tab-2">Validate</label>
<div class="content">
<form method="post" enctype="multipart/form-data" action="/api/v1/validate">
<label for="txtSource1">Paste OpenAPI 3.0.x here:</label>
<textarea name="source" id="txtSource2" maxLength="150000" rows="7" cols="50"></textarea>
<p>
<button class="button" type="submit">Validate OpenAPI 3.0.x</button>
</form>
<form method="post" enctype="multipart/form-data" action="/api/v1/validate">
<label for="file2">Or...</label>
<input id="file2" type="file" name="filename" accept="application/json,text/yaml,application/yaml">
<p>
<button class="button">Upload File</button>
</form>
</div>
</div>
<div class="tab">
<input type="radio" id="tab-3" name="tab-group-1">
<label class="tabLabel" for="tab-3">API</label>
<div class="content">
You may also use the API to convert Swagger 2.0 definitions or validate a 3.0.x definition
<ul>
<li><i>POST</i> <b>/api/v1/convert</b> - with a source or filename parameter</li>
<li><i>POST</i> <b>/api/v1/validate</b> - with a source or filename parameter</li>
<li><i>GET </i><b>/api/v1/convert?url=...</b> optionally with a <b>validate</b> parameter</li>
<li><i>GET </i><b>/api/v1/validate?url=...</b></li>
<li><i>GET </i><b>/api/v1/badge?url=...</b> returns a redirect to an SVG badge</li>
<li><i>GET </i><a href="/api/v1/status">/api/v1/status</a></li>
</ul>
<br/>
Full API <a href="https://redocly.github.io/redoc/?url=https://mermade.org.uk/contract/openapi.json">documentation</a> and <a href="http://petstore.swagger.io/?url=https://mermade.org.uk/contract/openapi.json">console</a> are also available
</div>
</div>
<div class="tab">
<input type="radio" id="tab-4" name="tab-group-1">
<label class="tabLabel" for="tab-4">Examples</label>
<div class="content">
<h3>Example definitions</h3>
<ul>
<li><a href="/examples/swagger.json">Petstore Demo - Swagger 2.0</a></li>
<li><a href="/examples/openapi.json">Petstore Demo - OpenAPI 3.0.0</a></li>
<li><a href="/contract/swagger.json">OpenAPI-Converter API - Swagger 2.0</a></li>
<li><a href="/contract/openapi.json">OpenAPI-Converter API - OpenAPI 3.0.0</a></li>
</ul>
<h3>Test Cases</h3>
<ul>
<li><a href="https://github.com/mermade/openapi3-examples">Passing and failing test-cases</a></li>
</ul>
</div>
</div>
<div class="tab">
<input type="radio" id="tab-5" name="tab-group-1">
<label class="tabLabel" for="tab-5">About</label>
<div class="content">
Conversion and validation is carried out by <a href="https://github.com/mermade/swagger2openapi">Swagger2OpenAPI</a>
<p>
Swagger2OpenAPI version <%= s2oVersion %> tracks the <%= targetVersion %> version of the
<a href="https://github.com/OAI/OpenAPI-Specification">OpenAPI Specification</a>
<% if (targetVersion.toLowerCase().indexOf('rc')>=0) { %>
<p>
<b>Warning:</b> This is a Release Candidate version of the specification and changes may be made before the final release,
and Swagger2OpenAPI may be in flux tracking these changes.
<% } %>
</div>
</div>
</div>
</div>
</body>
</html>