Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new generator: typescript-rxjs #1884

Merged
merged 25 commits into from
Jan 21, 2019
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
261a682
Merged in feature/rxjs (pull request #2)
denyo Jan 11, 2019
b9287cb
add bash scripts to generate samples
denyo Jan 11, 2019
8ba509f
remove environment import
denyo Jan 11, 2019
658f9e6
add rxjs dependency to package.mustache
denyo Jan 11, 2019
6ac3dc7
add genereated samples
denyo Jan 11, 2019
9dd2c05
add docs
denyo Jan 11, 2019
e36c397
add windows scripts
denyo Jan 11, 2019
fa6b78f
adjust license info
denyo Jan 11, 2019
1190e78
update "ensure-up-to-date" by typescript-rxjs
denyo Jan 14, 2019
d4c5318
Update modules/openapi-generator/src/main/resources/typescript-rxjs/r…
macjohnny Jan 15, 2019
26f65ca
Update modules/openapi-generator/src/main/resources/typescript-rxjs/r…
macjohnny Jan 15, 2019
d509a21
Update modules/openapi-generator/src/main/resources/typescript-rxjs/r…
macjohnny Jan 15, 2019
1b9a5cd
Update modules/openapi-generator/src/main/resources/typescript-rxjs/r…
macjohnny Jan 15, 2019
cefde8a
Update modules/openapi-generator/src/main/resources/typescript-rxjs/r…
macjohnny Jan 15, 2019
80f96ca
Update modules/openapi-generator/src/main/resources/typescript-rxjs/r…
macjohnny Jan 15, 2019
8c420c1
Update modules/openapi-generator/src/main/resources/typescript-rxjs/r…
macjohnny Jan 15, 2019
07b2bda
Update modules/openapi-generator/src/main/resources/typescript-rxjs/r…
macjohnny Jan 15, 2019
b7204bb
Update modules/openapi-generator/src/main/resources/typescript-rxjs/a…
macjohnny Jan 15, 2019
7850875
fix missing return for Observable<void>
denyo Jan 15, 2019
8305c12
use shorthand syntax
denyo Jan 15, 2019
b961748
improve linting
denyo Jan 15, 2019
ee642a7
improve linting
denyo Jan 15, 2019
5018e5f
revert previous changes
denyo Jan 15, 2019
335827b
Revert "Update modules/openapi-generator/src/main/resources/typescrip…
denyo Jan 15, 2019
106ae4b
recreate typescript-rxjs samples
denyo Jan 15, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se

| | Languages/Frameworks |
|-|-|
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 7.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node)
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 7.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs)
**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), Scalatra)
**API documentation generators** | **HTML**, **Confluence Wiki**
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
Expand Down Expand Up @@ -613,6 +613,7 @@ Here is a list of template creators:
* TypeScript (Fetch): @leonyu
* TypeScript (jQuery): @bherila
* TypeScript (Node): @mhardorf
* TypeScript (Rxjs): @denyo
* Server Stubs
* Ada: @stcarrez
* C# ASP.NET5: @jimschubert
Expand Down
6 changes: 6 additions & 0 deletions bin/typescript-rxjs-petstore-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

./bin/typescript-rxjs-petstore-target-es6.sh
./bin/typescript-rxjs-petstore-with-npm-version.sh
./bin/typescript-rxjs-petstore-interfaces.sh
./bin/typescript-rxjs-petstore.sh
32 changes: 32 additions & 0 deletions bin/typescript-rxjs-petstore-interfaces.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done

if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn -B clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -o samples/client/petstore/typescript-rxjs/builds/with-interfaces -D withInterfaces=true $@"

java $JAVA_OPTS -jar $executable $ags
7 changes: 7 additions & 0 deletions bin/typescript-rxjs-petstore-target-es6.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"npmName": "@swagger/typescript-rxjs-petstore",
"npmVersion": "1.0.0",
"npmRepository" : "https://skimdb.npmjs.com/registry",
"snapshot" : false,
"supportsES6": true
}
32 changes: 32 additions & 0 deletions bin/typescript-rxjs-petstore-target-es6.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done

if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn -B clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -c bin/typescript-rxjs-petstore-target-es6.json -o samples/client/petstore/typescript-rxjs/builds/es6-target $@"

java $JAVA_OPTS -jar $executable $ags
6 changes: 6 additions & 0 deletions bin/typescript-rxjs-petstore-with-npm-version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"npmName": "@swagger/typescript-rxjs-petstore",
"npmVersion": "1.0.0",
"npmRepository" : "https://skimdb.npmjs.com/registry",
"snapshot" : false
}
32 changes: 32 additions & 0 deletions bin/typescript-rxjs-petstore-with-npm-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done

if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn -B clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -c bin/typescript-rxjs-petstore-with-npm-version.json -o samples/client/petstore/typescript-rxjs/builds/with-npm-version $@"

java $JAVA_OPTS -jar $executable $ags
32 changes: 32 additions & 0 deletions bin/typescript-rxjs-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh
denyo marked this conversation as resolved.
Show resolved Hide resolved

SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"

while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done

if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"

if [ ! -f "$executable" ]
then
mvn -B clean package
fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-rxjs -o samples/client/petstore/typescript-rxjs/builds/default $@"

java $JAVA_OPTS -jar $executable $ags
1 change: 1 addition & 0 deletions bin/utils/ensure-up-to-date
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ declare -a scripts=("./bin/openapi3/ruby-client-petstore.sh"
"./bin/typescript-fetch-petstore-all.sh"
"./bin/typescript-node-petstore-all.sh"
"./bin/typescript-inversify-petstore.sh"
"./bin/typescript-rxjs-petstore.sh"
"./bin/rust-server-petstore.sh"
"./bin/haskell-http-client-petstore.sh"
"./bin/csharp-petstore.sh"
Expand Down
6 changes: 6 additions & 0 deletions bin/windows/typescript-rxjs-petstore-all.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@ECHO OFF

call bin\windows\typescript-rxjs-petstore.bat
call bin\windows\typescript-rxjs-petstore-target-es6.bat
call bin\windows\typescript-rxjs-petstore-with-npm-version.bat
call bin\windows\typescript-rxjs-petstore-interfaces.bat
12 changes: 12 additions & 0 deletions bin/windows/typescript-rxjs-petstore-interfaces.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@ECHO OFF

set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar

If Not Exist %executable% (
mvn clean package
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-rxjs -o samples\client\petstore\typescript-rxjs\builds\with-interfaces -D withInterfaces=true

java %JAVA_OPTS% -jar %executable% %ags%
12 changes: 12 additions & 0 deletions bin/windows/typescript-rxjs-petstore-target-es6.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@ECHO OFF

set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar

If Not Exist %executable% (
mvn clean package
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-rxjs -c bin\typescript-rxjs-petstore-target-es6.json -o samples\client\petstore\typescript-rxjs\builds\es6-target

java %JAVA_OPTS% -jar %executable% %ags%
12 changes: 12 additions & 0 deletions bin/windows/typescript-rxjs-petstore-with-npm-version.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@ECHO OFF

set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar

If Not Exist %executable% (
mvn clean package
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-rxjs -c bin\typescript-rxjs-petstore-with-npm-version.json -o samples\client\petstore\typescript-rxjs\builds\with-npm-version

java %JAVA_OPTS% -jar %executable% %ags%
14 changes: 14 additions & 0 deletions bin/windows/typescript-rxjs-petstore.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@ECHO OFF

set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar

If Not Exist %executable% (
mvn clean package
)

REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M

echo
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-rxjs -o samples\client\petstore\typescript-rxjs\builds\default

java %JAVA_OPTS% -jar %executable% %ags%
1 change: 1 addition & 0 deletions docs/generators/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ The following generators are available:
- [typescript-inversify](typescript-inversify.md)
- [typescript-jquery](typescript-jquery.md)
- [typescript-node](typescript-node.md)
- [typescript-rxjs](typescript-rxjs.md)


* SERVER generators:
Expand Down
37 changes: 37 additions & 0 deletions docs/generators/typescript-rxjs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

CONFIG OPTIONS for typescript-rxjs

sortParamsByRequiredFlag
Sort method arguments to place required parameters before optional parameters. (Default: true)

ensureUniqueParams
Whether to ensure parameter names are unique in an operation (rename parameters that are not). (Default: true)

allowUnicodeIdentifiers
boolean, toggles whether unicode identifiers are allowed in names or not, default is false (Default: false)

prependFormOrBodyParameters
Add form or body parameters to the beginning of the parameter list. (Default: false)

modelPropertyNaming
Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name (Default: camelCase)

supportsES6
Generate code that conforms to ES6. (Default: false)

npmName
The name under which you want to publish generated npm package

npmVersion
The version of your npm package

npmRepository
Use this property to set an url your private npmRepo in the package.json

snapshot
When setting this property to true the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm (Default: false)

withInterfaces
Setting this property to true will generate interfaces next to the default class implementations. (Default: false)

Back to the [generators list](README.md)
Loading