You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package generates TypeScript typedefs and API Client from the OpenAPI v3 series API specification.
6
-
It uses TypeScript AST to generate the code, and converts it exactly to TypeScript code.
7
-
It not only converts `allOf` and `oneOf` into `intersection` type and `union` type, but also converts the directory structure of the reference destination into `namespace` and generates the API Client.
8
-
The hierarchical structure of the directory is converted to the hierarchical structure of the type definition.
5
+
This library provides TypeScript type definitions and extracted parameters from OpenAPI v3.0.x compliant specifications.
6
+
TypeScript AST is used to generate the code, which is accurately converted to TypeScript code.
7
+
Since the parameters extracted from OpenAPI can be used freely, it can be used for automatic generation of API Client and Server Side code, load balancer configuration files, etc.
9
8
10
9
## Usage
11
10
@@ -17,63 +16,253 @@ The hierarchical structure of the directory is converted to the hierarchical str
We have an entry point in `option.rewriteCodeAfterTypeDeclaration` to generate non-typed code.
47
-
The first argument can be TypeScript's `TransformationContext`, and the second argument contains the information of the type definition generated before this.
48
-
By using [ts-ast-viewer](https://ts-ast-viewer.com), code extension by AST can facilitate code extension.
This is a type definition file for `Templates.ApiClient`. The reason it is not included in `generateTypeDefinition` is that you may not use the type definition generated by this function depending on your usage.
238
+
239
+
※ The reason it is not included in `generateTypeDefinition` is that you may not use the type definitions generated by this function depending on your application.
There is a limitation on the directory structure supported.
79
268
To simplify implementation when converting directory structures to TypeScript namespaces, Remote References using `$ref` should only be defined in the following directory structures.
@@ -91,7 +280,7 @@ components/
91
280
paths/
92
281
```
93
282
94
-
####HTTP communication restrictions for Remote Reference
283
+
### HTTP communication restrictions for Remote Reference
95
284
96
285
`$ref: http://....` Currently not supported. We hope to support it in the future.
97
286
@@ -103,7 +292,7 @@ Adding test cases is a very powerful support for stabilizing the behavior, so pl
103
292
Also, the basic design concepts of this repository can be found below. If you want to make changes that do not follow these concepts, please fork and extend them.
104
293
If your changes are in line with the design concept, please submit a pull request or issue!
105
294
106
-
###Design Concept
295
+
## Design Concept
107
296
108
297
- Be typedef first.
109
298
- Typedefs should not contain any entities (file size should be 0 when typedefs are converted to `.js`)
@@ -113,7 +302,7 @@ If your changes are in line with the design concept, please submit a pull reques
113
302
- Conform to the OpenAPI specification.
114
303
- It should be a single file to maintain portability.
0 commit comments