7
7
< meta http-equiv ="Content-Type " content ="text/html; charset=UTF-8 ">
8
8
< link rel ="stylesheet " href ="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css " crossorigin ="anonymous ">
9
9
< link rel ="stylesheet " href ="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css " crossorigin ="anonymous ">
10
- < title > Compared to other libraries </ title >
10
+ < title > Compared to other generators </ title >
11
11
</ head >
12
12
< body >
13
13
< div class ="container ">
14
- < div class ="page-header ">
15
- < h1 > Compared to other libraries </ h1 >
14
+ < section class ="page-header ">
15
+ < h1 > Compared to other generators </ h1 >
16
16
< p class ="lead ">
17
- Depending on which generator you use, you will see different output. For instance:
17
+ Depending on which swagger generator you use, you will see different output. For instance:
18
18
Different ways of generating models, services, level of quality, HTTP client, etc.
19
19
I've compiled a list below with the results per area and how they compare
20
- against the openapi-typescript-codegen.
20
+ against the < strong > openapi-typescript-codegen.</ strong >
21
21
</ p >
22
- </ div >
22
+ </ section >
23
23
< h5 > I've used the standard petshop examples from OpenAPI:</ h5 >
24
24
< ul >
25
25
< li > < a href ="https://petstore3.swagger.io/api/v3/openapi.json " target ="_blank "> https://petstore3.swagger.io/api/v3/openapi.json</ a > </ li >
@@ -41,7 +41,7 @@ <h5>And used the following generators with their default options:</h5>
41
41
< thead >
42
42
< tr >
43
43
< th width ="30% "> </ th >
44
- < th width ="10% "> openapi-typscript -codegen</ th >
44
+ < th width ="10% "> openapi-typescript -codegen</ th >
45
45
< th width ="10% "> aurelia</ th >
46
46
< th width ="10% "> inversify</ th >
47
47
< th width ="10% "> angular</ th >
@@ -53,7 +53,7 @@ <h5>And used the following generators with their default options:</h5>
53
53
< tbody >
54
54
< tr >
55
55
< th > Supports OpenApi v2 specification</ th >
56
- < td class ="success " data-type ="openapi-typscript -codegen "> ✅</ td >
56
+ < td class ="success " data-type ="openapi-typescript -codegen "> ✅</ td >
57
57
< td class ="success " data-type ="aurelia "> ✅</ td >
58
58
< td class ="success " data-type ="inversify "> ✅</ td >
59
59
< td class ="success " data-type ="angular "> ✅</ td >
@@ -63,7 +63,7 @@ <h5>And used the following generators with their default options:</h5>
63
63
</ tr >
64
64
< tr >
65
65
< th > Supports OpenApi v3 specification</ th >
66
- < td class ="success " data-type ="openapi-typscript -codegen "> ✅</ td >
66
+ < td class ="success " data-type ="openapi-typescript -codegen "> ✅</ td >
67
67
< td class ="danger " data-type ="aurelia "> ❌</ td >
68
68
< td class ="danger " data-type ="inversify "> ❌</ td >
69
69
< td class ="success " data-type ="angular "> ✅</ td >
@@ -73,7 +73,7 @@ <h5>And used the following generators with their default options:</h5>
73
73
</ tr >
74
74
< tr >
75
75
< th > Supports authentication</ th >
76
- < td class ="success " data-type ="openapi-typscript -codegen "> ✅</ td >
76
+ < td class ="success " data-type ="openapi-typescript -codegen "> ✅</ td >
77
77
< td class ="danger " data-type ="aurelia "> ❌</ td >
78
78
< td class ="success " data-type ="inversify "> ✅</ td >
79
79
< td class ="success " data-type ="angular "> ✅</ td >
@@ -83,7 +83,7 @@ <h5>And used the following generators with their default options:</h5>
83
83
</ tr >
84
84
< tr >
85
85
< th > Strongly typed models</ th >
86
- < td class ="success " data-type ="openapi-typscript -codegen "> ✅</ td >
86
+ < td class ="success " data-type ="openapi-typescript -codegen "> ✅</ td >
87
87
< td class ="success " data-type ="aurelia "> ✅</ td >
88
88
< td class ="success " data-type ="inversify "> ✅</ td >
89
89
< td class ="success " data-type ="angular "> ✅</ td >
@@ -93,7 +93,7 @@ <h5>And used the following generators with their default options:</h5>
93
93
</ tr >
94
94
< tr >
95
95
< th > Strongly typed enums</ th >
96
- < td class ="success " data-type ="openapi-typscript -codegen "> ✅</ td >
96
+ < td class ="success " data-type ="openapi-typescript -codegen "> ✅</ td >
97
97
< td class ="success " data-type ="aurelia "> ✅</ td >
98
98
< td class ="success " data-type ="inversify "> ✅</ td >
99
99
< td class ="success " data-type ="angular "> ✅</ td >
@@ -103,7 +103,7 @@ <h5>And used the following generators with their default options:</h5>
103
103
</ tr >
104
104
< tr >
105
105
< th > Models and services exported as individual files</ th >
106
- < td class ="success " data-type ="openapi-typscript -codegen "> ✅</ td >
106
+ < td class ="success " data-type ="openapi-typescript -codegen "> ✅</ td >
107
107
< td class ="danger " data-type ="aurelia "> ❌</ td >
108
108
< td class ="success " data-type ="inversify "> ✅</ td >
109
109
< td class ="success " data-type ="angular "> ✅</ td >
@@ -113,7 +113,7 @@ <h5>And used the following generators with their default options:</h5>
113
113
</ tr >
114
114
< tr >
115
115
< th > Index file that exports all services and models</ th >
116
- < td class ="success " data-type ="openapi-typscript -codegen "> ✅</ td >
116
+ < td class ="success " data-type ="openapi-typescript -codegen "> ✅</ td >
117
117
< td class ="success " data-type ="aurelia "> ✅</ td >
118
118
< td class ="danger " data-type ="inversify "> ❌</ td >
119
119
< td class ="success " data-type ="angular "> ✅</ td >
@@ -123,7 +123,7 @@ <h5>And used the following generators with their default options:</h5>
123
123
</ tr >
124
124
< tr >
125
125
< th > Service returns typed result</ th >
126
- < td class ="success " data-type ="openapi-typscript -codegen "> ✅</ td >
126
+ < td class ="success " data-type ="openapi-typescript -codegen "> ✅</ td >
127
127
< td class ="success " data-type ="aurelia "> ✅</ td >
128
128
< td class ="success " data-type ="inversify "> ✅</ td >
129
129
< td class ="success " data-type ="angular "> ✅</ td >
@@ -133,17 +133,27 @@ <h5>And used the following generators with their default options:</h5>
133
133
</ tr >
134
134
< tr >
135
135
< th > Service supports sending and receiving binary content</ th >
136
- < td class ="success " data-type ="openapi-typscript -codegen "> ✅</ td >
136
+ < td class ="success " data-type ="openapi-typescript -codegen "> ✅</ td >
137
137
< td class ="success " data-type ="aurelia "> ✅</ td >
138
138
< td class ="success " data-type ="inversify "> ✅</ td >
139
- < td class ="danger " data-type ="angular "> ❌</ td >
140
- < td class ="danger " data-type ="fetch "> ❌</ td >
139
+ < td class ="warning " data-type ="angular ">
140
+ < details >
141
+ < summary > ⚠️</ summary >
142
+ < p > V3 version sends data as < code > application/octet-stream</ code > instead of < code > application/x-www-form-urlencoded</ code > </ p >
143
+ </ details >
144
+ </ td >
145
+ < td class ="warning " data-type ="fetch ">
146
+ < details >
147
+ < summary > ⚠️</ summary >
148
+ < p > V3 version sends data as < code > application/octet-stream</ code > instead of < code > application/x-www-form-urlencoded</ code > </ p >
149
+ </ details >
150
+ </ td >
141
151
< td class ="success " data-type ="jquery "> ✅</ td >
142
152
< td class ="success " data-type ="node "> ✅</ td >
143
153
</ tr >
144
154
< tr >
145
155
< th > Models and services contain inline documentation</ th >
146
- < td class ="success " data-type ="openapi-typscript -codegen "> ✅</ td >
156
+ < td class ="success " data-type ="openapi-typescript -codegen "> ✅</ td >
147
157
< td class ="success " data-type ="aurelia "> ✅</ td >
148
158
< td class ="success " data-type ="inversify "> ✅</ td >
149
159
< td class ="success " data-type ="angular "> ✅</ td >
@@ -153,46 +163,97 @@ <h5>And used the following generators with their default options:</h5>
153
163
</ tr >
154
164
< tr >
155
165
< th > Framework agnostic</ th >
156
- < td class ="success " data-type ="openapi-typscript -codegen "> ✅</ td >
166
+ < td class ="success " data-type ="openapi-typescript -codegen "> ✅</ td >
157
167
< td class ="danger " data-type ="aurelia "> ❌</ td >
158
168
< td class ="danger " data-type ="inversify "> ❌</ td >
159
169
< td class ="danger " data-type ="angular "> ❌</ td >
160
- < td class ="success " data-type ="fetch "> ✅</ td >
170
+ < td class ="warning " data-type ="node ">
171
+ < details >
172
+ < summary > ⚠️</ summary >
173
+ < p > Requires portable-fetch</ p >
174
+ </ details >
175
+ </ td >
161
176
< td class ="danger " data-type ="jquery "> ❌</ td >
162
- < td class ="danger " data-type ="node "> ❌</ td >
177
+ < td class ="warning " data-type ="node ">
178
+ < details >
179
+ < summary > ⚠️</ summary >
180
+ < p > Requires bluebird</ p >
181
+ </ details >
182
+ </ td >
183
+ </ tr >
184
+ < tr >
185
+ < th > Compiles in strict mode without issues</ th >
186
+ < td class ="success " data-type ="openapi-typescript-codegen "> ✅</ td >
187
+ < td class ="danger " data-type ="aurelia ">
188
+ < details >
189
+ < summary > ❌</ summary >
190
+ < p > Errors when compiling: < code > PetApi.ts:147:30 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'</ code > </ p >
191
+ </ details >
192
+ </ td >
193
+ < td class ="danger " data-type ="inversify ">
194
+ < details >
195
+ < summary > ❌</ summary >
196
+ < p > Errors when compiling: < code > pet.service.ts:312:159 - error TS2304: Cannot find name 'body'</ code > </ p >
197
+ </ details >
198
+ </ td >
199
+ < td class ="danger " data-type ="angular ">
200
+ < details >
201
+ < summary > ❌</ summary >
202
+ < p > Errors when compiling: < code > pet.service.ts:528:26 - error TS1345: An expression of type 'void' cannot be tested for truthiness</ code > </ p >
203
+ </ details >
204
+ </ td >
205
+ < td class ="danger " data-type ="fetch ">
206
+ < details >
207
+ < summary > ❌</ summary >
208
+ < p > Errors when compiling: < code > api.ts:2276:67 - error TS2300: Duplicate identifier 'username'</ code > </ p >
209
+ </ details >
210
+ </ td >
211
+ < td class ="danger " data-type ="jquery ">
212
+ < details >
213
+ < summary > ❌</ summary >
214
+ < p > Errors when compiling: < code > PetApi.ts:25:12 - error TS2322: Type 'null' is not assignable to type 'JQueryAjaxSettings | undefined'</ code > </ p >
215
+ </ details >
216
+ </ td >
217
+ < td class ="danger " data-type ="node ">
218
+ < details >
219
+ < summary > ❌</ summary >
220
+ < p > Errors when compiling: < code > api.ts:1631:45 - error TS2694: Namespace '"http"' has no exported member 'ClientResponse'</ code > </ p >
221
+ </ details >
222
+ </ td >
163
223
</ tr >
164
224
< tr >
165
225
< th > Generated size (typescript)</ th >
166
- < td > < span class =" badge " data-type ="openapi-typscript -codegen "> 30Kb </ span > </ td >
167
- < td > < span class ="badge " data-type =" aurelia " > 30Kb </ span > </ td >
168
- < td > < span class ="badge " data-type =" inversify " > 30Kb </ span > </ td >
169
- < td > < span class ="badge " data-type =" angular " > 30Kb </ span > </ td >
170
- < td > < span class ="badge " data-type =" fetch " > 30Kb </ span > </ td >
171
- < td > < span class ="badge " data-type =" jquery " > 30Kb </ span > </ td >
172
- < td > < span class ="badge " data-type =" node " > 30Kb </ span > </ td >
226
+ < td data-type ="openapi-typescript -codegen "> < span class =" badge " > 30KB </ span > </ td >
227
+ < td data-type =" aurelia " > < span class ="badge "> 29KB </ span > </ td >
228
+ < td data-type =" inversify " > < span class ="badge "> 37KB </ span > </ td >
229
+ < td data-type =" angular " > < span class ="badge "> 63KB </ span > </ td >
230
+ < td data-type =" fetch " > < span class ="badge "> 85KB </ span > </ td >
231
+ < td data-type =" jquery " > < span class ="badge "> 57KB </ span > </ td >
232
+ < td data-type =" node " > < span class ="badge "> 65KB </ span > </ td >
173
233
</ tr >
174
234
< tr >
175
- < th > Build size (javascript)</ th >
176
- < td > < span class =" badge " data-type ="openapi-typscript -codegen "> 30Kb </ span > </ td >
177
- < td > < span class ="badge " data-type =" aurelia " > 30Kb </ span > </ td >
178
- < td > < span class ="badge " data-type =" inversify " > 30Kb </ span > </ td >
179
- < td > < span class ="badge " data-type =" angular " > 30Kb </ span > </ td >
180
- < td > < span class ="badge " data-type =" fetch " > 30Kb </ span > </ td >
181
- < td > < span class ="badge " data-type =" jquery " > 30Kb </ span > </ td >
182
- < td > < span class ="badge " data-type =" node " > 30Kb </ span > </ td >
235
+ < th > Build size (javascript, not minimized )</ th >
236
+ < td data-type ="openapi-typescript -codegen "> < span class =" badge " > 17KB </ span > </ td >
237
+ < td data-type =" aurelia " > < span class ="badge "> 16KB </ span > </ td >
238
+ < td data-type =" inversify " > < span class ="badge "> 22KB </ span > </ td >
239
+ < td data-type =" angular " > < span class ="badge "> 36KB </ span > </ td >
240
+ < td data-type =" fetch " > < span class ="badge "> 48KB </ span > </ td >
241
+ < td data-type =" jquery " > < span class ="badge "> 37KB </ span > </ td >
242
+ < td data-type =" node " > < span class ="badge "> 53KB </ span > </ td >
183
243
</ tr >
184
244
< tr >
185
245
< th > Generation time</ th >
186
- < td > < span class =" badge " data-type ="openapi-typscript -codegen "> 0.132s</ span > </ td >
187
- < td > < span class ="badge " data-type =" aurelia "> 0.715s</ span > </ td >
188
- < td > < span class ="badge " data-type =" inversify "> 0.788s</ span > </ td >
189
- < td > < span class ="badge " data-type =" angular "> 1.386s</ span > </ td >
190
- < td > < span class ="badge " data-type =" fetch "> 1.103s</ span > </ td >
191
- < td > < span class ="badge " data-type =" jquery "> 0.728s</ span > </ td >
192
- < td > < span class ="badge " data-type =" node "> 0.752s</ span > </ td >
246
+ < td data-type ="openapi-typescript -codegen " > < span class =" badge "> 0.132s</ span > </ td >
247
+ < td data-type =" aurelia " > < span class ="badge "> 0.715s</ span > </ td >
248
+ < td data-type =" inversify " > < span class ="badge "> 0.788s</ span > </ td >
249
+ < td data-type =" angular " > < span class ="badge "> 1.386s</ span > </ td >
250
+ < td data-type =" fetch " > < span class ="badge "> 1.103s</ span > </ td >
251
+ < td data-type =" jquery " > < span class ="badge "> 0.728s</ span > </ td >
252
+ < td data-type =" node " > < span class ="badge "> 0.752s</ span > </ td >
193
253
</ tr >
194
254
</ tbody >
195
255
</ table >
256
+ < script src ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js " crossorigin ="anonymous "> </ script >
196
257
</ div >
197
258
</ body >
198
259
</ html >
0 commit comments