|
| 1 | +# Compare to other libraries |
| 2 | + |
| 3 | +Depending on which generator you use, you will see different output. For instance: |
| 4 | +Different ways of generating models, services, level of quality, HTTP client, etc. |
| 5 | +I've compiled a list below with the results per area and how they compare |
| 6 | +against the openapi-typescript-codegen. |
| 7 | + |
| 8 | +I've used the standard petshop examples from OpenAPI: |
| 9 | +- https://petstore3.swagger.io/api/v3/openapi.json |
| 10 | +- https://petstore.swagger.io/v2/swagger.json |
| 11 | + |
| 12 | +And used the following generators with their default options: |
| 13 | + |
| 14 | +- typescript-aurelia |
| 15 | +- typescript-angular |
| 16 | +- typescript-inversify |
| 17 | +- typescript-angular |
| 18 | +- typescript-fetch |
| 19 | +- typescript-jquery |
| 20 | +- typescript-node |
| 21 | + |
| 22 | +#Results |
| 23 | + |
| 24 | +<table> |
| 25 | + <thead> |
| 26 | + <tr> |
| 27 | + <th></th> |
| 28 | + <th>openapi-typscript-codegen</th> |
| 29 | + <th>aurelia</th> |
| 30 | + <th>inversify</th> |
| 31 | + <th>angular</th> |
| 32 | + <th>fetch</th> |
| 33 | + <th>jquery</th> |
| 34 | + <th>node</th> |
| 35 | + </tr> |
| 36 | + </thead> |
| 37 | + <tbody> |
| 38 | + <tr> |
| 39 | + <th>Supports OpenApi v2 specification</th> |
| 40 | + <td>✅</td> |
| 41 | + <td>✅</td> |
| 42 | + <td>✅</td> |
| 43 | + <td>✅</td> |
| 44 | + <td>✅</td> |
| 45 | + <td>✅</td> |
| 46 | + <td>✅</td> |
| 47 | + </tr> |
| 48 | + <tr> |
| 49 | + <th>Supports OpenApi v3 specification</th> |
| 50 | + <td>✅</td> |
| 51 | + <td>❌</td> |
| 52 | + <td>❌</td> |
| 53 | + <td>✅</td> |
| 54 | + <td>✅</td> |
| 55 | + <td>❌</td> |
| 56 | + <td>❌</td> |
| 57 | + </tr> |
| 58 | + <tr> |
| 59 | + <th>Supports authentication</th> |
| 60 | + <td>✅ Bearer token</td> |
| 61 | + <td>❌</td> |
| 62 | + <td>✅ Bearer token</td> |
| 63 | + <td>✅ Bearer token</td> |
| 64 | + <td>✅ Bearer token</td> |
| 65 | + <td>✅ Bearer token</td> |
| 66 | + <td>✅ Bearer token</td> |
| 67 | + </tr> |
| 68 | + <tr> |
| 69 | + <th>Strongly typed models</th> |
| 70 | + <td>✅</td> |
| 71 | + <td>✅</td> |
| 72 | + <td>✅</td> |
| 73 | + <td>✅</td> |
| 74 | + <td>✅</td> |
| 75 | + <td>✅</td> |
| 76 | + <td>✅ Using classes instead of simple interfaces</td> |
| 77 | + </tr> |
| 78 | + <tr> |
| 79 | + <th>Strongly typed enums</th> |
| 80 | + <td>✅</td> |
| 81 | + <td>✅ No enum is exported</td> |
| 82 | + <td>✅</td> |
| 83 | + <td>✅ Odd cast to <code><any></code></td> |
| 84 | + <td>✅ Odd cast to <code><any></code></td> |
| 85 | + <td>✅ Odd cast to <code><any></code></td> |
| 86 | + <td>✅ Odd cast to <code><any></code></td> |
| 87 | + </tr> |
| 88 | + <tr> |
| 89 | + <th>Models and services exported as individual files</th> |
| 90 | + <td>✅</td> |
| 91 | + <td>❌ All models inside one file</td> |
| 92 | + <td>✅</td> |
| 93 | + <td>✅</td> |
| 94 | + <td>❌ All models and services inside one file</td> |
| 95 | + <td>✅</td> |
| 96 | + <td>❌ All models and services inside one file</td> |
| 97 | + </tr> |
| 98 | + <tr> |
| 99 | + <th>Index file that exports all services and models</th> |
| 100 | + <td>✅</td> |
| 101 | + <td>✅</td> |
| 102 | + <td>❌</td> |
| 103 | + <td>✅</td> |
| 104 | + <td>✅</td> |
| 105 | + <td>✅</td> |
| 106 | + <td>❌</td> |
| 107 | + </tr> |
| 108 | + <tr> |
| 109 | + <th>Service returns typed result</th> |
| 110 | + <td>✅</td> |
| 111 | + <td>✅</td> |
| 112 | + <td>✅</td> |
| 113 | + <td>✅</td> |
| 114 | + <td>❌</td> |
| 115 | + <td>✅</td> |
| 116 | + <td>✅</td> |
| 117 | + </tr> |
| 118 | + <tr> |
| 119 | + <th>Service supports sending and receiving binary content</th> |
| 120 | + <td>✅</td> |
| 121 | + <td>✅</td> |
| 122 | + <td>✅</td> |
| 123 | + <td>❌ Passing file as application/octet-stream</td> |
| 124 | + <td>❌ Passing file as application/octet-stream</td> |
| 125 | + <td>✅</td> |
| 126 | + <td>✅</td> |
| 127 | + </tr> |
| 128 | + <tr> |
| 129 | + <th>Models and services contain inline documentation</th> |
| 130 | + <td>✅</td> |
| 131 | + <td>❌</td> |
| 132 | + <td>❌</td> |
| 133 | + <td>❌</td> |
| 134 | + <td>❌</td> |
| 135 | + <td>❌</td> |
| 136 | + <td>❌</td> |
| 137 | + </tr> |
| 138 | + <tr> |
| 139 | + <th>Framework agnostic</th> |
| 140 | + <td>✅</td> |
| 141 | + <td>❌ No, using <code>aurelia</code></td> |
| 142 | + <td>❌ No, using <code>inversify</code> and <code>rxjs</code></td> |
| 143 | + <td>❌ No, using <code>angular</code></td> |
| 144 | + <td>✅ But depends on <code>portable-fetch</code></td> |
| 145 | + <td>❌ No, using <code>jquery</code></td> |
| 146 | + <td>❌ No, can only be used with NodeJS <code>http</code></td> |
| 147 | + </tr> |
| 148 | + </tbody> |
| 149 | +</table> |
0 commit comments