@ama-sdk/openapi-codegen-typescript 0.0.0-placeholder

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # Swagger Codegen for the typescriptFetch library
2
+
3
+ ## Overview
4
+ This is a boiler-plate project to generate your own client library with Swagger. Its goal is
5
+ to get you started with the basic plumbing so you can put in your own logic. It won't work without
6
+ your changes applied.
7
+
8
+ ## What's Swagger?
9
+ The goal of Swaggerâ„¢ is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined via Swagger, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, Swagger removes the guesswork in calling the service.
10
+
11
+
12
+ Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the Swagger project, including additional libraries with support for other languages and more.
13
+
14
+ ## How do I use this?
15
+ At this point, you've likely generated a client setup. It will include something along these lines:
16
+
17
+ ```
18
+ .
19
+ |- README.md // this file
20
+ |- pom.xml // build script
21
+ |-- src
22
+ |--- main
23
+ |---- java
24
+ |----- com.amadeus.codegen.ts.TypescriptfetchGenerator.java // generator file
25
+ |---- resources
26
+ |----- typescriptFetch // template files
27
+ |----- META-INF
28
+ |------ services
29
+ |------- io.swagger.codegen.CodegenConfig
30
+ ```
31
+
32
+ You _will_ need to make changes in at least the following:
33
+
34
+ `TypescriptfetchGenerator.java`
35
+
36
+ Templates in this folder:
37
+
38
+ `src/main/resources/typescriptFetch`
39
+
40
+ Once modified, you can run this:
41
+
42
+ ```
43
+ mvn package
44
+ ```
45
+
46
+ In your generator project. A single jar file will be produced in `target`. You can now use that with codegen:
47
+
48
+ ```
49
+ java -cp /path/to/swagger-codegen-distribution:/path/to/your/jar io.swagger.codegen.Codegen -l typescriptFetch -o
50
+ ./test-sdk
51
+ ```
52
+
53
+ Now your templates are available to the client generator and you can write output values
54
+
55
+ ## But how do I modify this?
56
+ The `TypescriptfetchGenerator.java` has comments in it--lots of comments. There is no good substitute
57
+ for reading the code more, though. See how the `TypescriptfetchGenerator` implements `CodegenConfig`.
58
+ That class has the signature of all values that can be overridden.
59
+
60
+ For the templates themselves, you have a number of values available to you for generation.
61
+ You can execute the `java` command from above while passing different debug flags to show
62
+ the object you have available during client generation:
63
+
64
+ ```
65
+ # The following additional debug options are available for all codegen targets:
66
+ # -DdebugSwagger prints the OpenAPI Specification as interpreted by the codegen
67
+ # -DdebugModels prints models passed to the template engine
68
+ # -DdebugOperations prints operations passed to the template engine
69
+ # -DdebugSupportingFiles prints additional data passed to the template engine
70
+
71
+ java -DdebugOperations -cp /path/to/swagger-codegen-distribution:/path/to/your/jar io.swagger.codegen.Codegen -l
72
+ typescriptFetch -o ./test-sdk
73
+ ```
74
+
75
+ Will, for example, output the debug info for operations. You can use this info
76
+ in the `api.mustache` file.
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@ama-sdk/openapi-codegen-typescript",
3
+ "version": "0.0.0-placeholder",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "scripts": {
8
+ "build:jar": "mvn clean package -f ./pom.xml && yarn run postbuild || true",
9
+ "postbuild": "yarn cpy ./target/typescriptFetch-openapi-generator.jar ./dist && yarn cpy ./package.json ./dist"
10
+ },
11
+ "main": "./target/typescriptFetch-openapi-generator.jar",
12
+ "exports": {
13
+ ".": "./target/typescriptFetch-openapi-generator.jar",
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "./target/typescriptFetch-openapi-generator.jar"
18
+ ],
19
+ "devDependencies": {
20
+ "cpy-cli": "^6.0.0"
21
+ }
22
+ }