forked from loafle/openapi-generator-original
Compare commits
1 Commits
ts-refacto
...
python-nul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26c0d991c0 |
18
.travis.yml
18
.travis.yml
@@ -21,9 +21,6 @@ cache:
|
||||
- $HOME/samples/client/petstore/php/OpenAPIToolsClient-php/vendor
|
||||
- $HOME/samples/client/petstore/ruby/vendor/bundle
|
||||
- $HOME/samples/client/petstore/python/.venv/
|
||||
- $HOME/samples/openapi3/client/petstore/typescript/tests/default/node_modules
|
||||
- $HOME/samples/openapi3/client/petstore/typescript/tests/jquery/node_modules
|
||||
- $HOME/samples/openapi3/client/petstore/typescript/tests/object_params/node_modules
|
||||
- $HOME/samples/client/petstore/typescript-node/npm/node_modules
|
||||
- $HOME/samples/client/petstore/typescript-node/npm/typings/
|
||||
- $HOME/samples/client/petstore/typescript-fetch/tests/default/node_modules
|
||||
@@ -104,9 +101,6 @@ before_install:
|
||||
# install Qt5
|
||||
- sudo apt install -y --no-install-recommends qt5-default
|
||||
- cmake --version
|
||||
# perl dep
|
||||
- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
|
||||
- cpanm --quiet --no-interactive Test::Exception Test::More Log::Any LWP::UserAgent URI::Query Module::Runtime DateTime Module::Find Moose::Role JSON || echo "Igorned failure from cpanm"
|
||||
# show host table to confirm petstore.swagger.io is mapped to localhost
|
||||
- cat /etc/hosts
|
||||
# show java version
|
||||
@@ -141,13 +135,13 @@ script:
|
||||
- /bin/bash ./bin/utils/detect_tab_in_java_class.sh
|
||||
# run integration tests defined in maven pom.xml
|
||||
# WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet.
|
||||
- mvn --no-snapshot-updates --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --no-snapshot-updates --quiet --batch-mode --show-version verify -Psamples -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --quiet --batch-mode --show-version verify -Psamples -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
# test maven plugin
|
||||
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
# test gradle plugin
|
||||
- (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk)
|
||||
- (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate)
|
||||
|
||||
@@ -34,4 +34,4 @@ script:
|
||||
- set -e
|
||||
# run integration tests defined in maven pom.xml
|
||||
- cp pom.xml.bash pom.xml
|
||||
- mvn --no-snapshot-updates --batch-mode verify -Psamples
|
||||
- mvn --batch-mode verify -Psamples
|
||||
|
||||
@@ -34,4 +34,4 @@ before_install:
|
||||
|
||||
script:
|
||||
# run integration tests defined in maven pom.xml
|
||||
- mvn --no-snapshot-updates -q --batch-mode verify -Psamples.ios -Dmaven.javadoc.skip=true
|
||||
- mvn -q --batch-mode verify -Psamples.ios -Dmaven.javadoc.skip=true
|
||||
|
||||
@@ -28,7 +28,7 @@ workflows:
|
||||
|
||||
set -e
|
||||
|
||||
mvn --no-snapshot-updates package -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
mvn package -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
title: Build openapi-generator
|
||||
- script@1.1.5:
|
||||
title: Update Swift samples
|
||||
|
||||
@@ -24,8 +24,8 @@ if [ "$NODE_INDEX" = "1" ]; then
|
||||
export PATH="/usr/local/go1.14/go/bin:$PATH"
|
||||
go version
|
||||
|
||||
mvn --no-snapshot-updates --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
mvn --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
mvn --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
mvn --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
|
||||
elif [ "$NODE_INDEX" = "2" ]; then
|
||||
# run ensure-up-to-date sample script on SNAPSHOT version only
|
||||
@@ -58,7 +58,7 @@ elif [ "$NODE_INDEX" = "2" ]; then
|
||||
sudo apt-get -y install libcurl4-gnutls-dev
|
||||
|
||||
# run integration tests
|
||||
mvn --no-snapshot-updates --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
mvn --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
else
|
||||
echo "Running node $NODE_INDEX to test 'samples.circleci.jdk7' defined in pom.xml ..."
|
||||
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
|
||||
@@ -73,7 +73,7 @@ else
|
||||
sudo apt-get install dart
|
||||
export PATH="$PATH:/usr/lib/dart/bin"
|
||||
|
||||
mvn --no-snapshot-updates --quiet verify -Psamples.circleci.jdk7 -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
mvn --quiet verify -Psamples.circleci.jdk7 -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ public class ApiClientTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore("There is no more basic auth in petstore security definitions")
|
||||
@Test
|
||||
public void testSetUsernameAndPassword() {
|
||||
HttpBasicAuth auth = null;
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import org.openapitools.client.model.Mammal;
|
||||
import org.openapitools.client.model.AppleReq;
|
||||
import org.openapitools.client.model.BananaReq;
|
||||
import org.openapitools.client.model.FruitReq;
|
||||
import org.openapitools.client.model.BasquePig;
|
||||
import org.openapitools.client.model.Pig;
|
||||
import org.openapitools.client.model.Whale;
|
||||
import org.openapitools.client.model.Zebra;
|
||||
import java.lang.Exception;
|
||||
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class JSONComposedSchemaTest {
|
||||
JSON json = null;
|
||||
Mammal mammal = null;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
json = new JSON();
|
||||
mammal = new Mammal();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a oneOf schema can be deserialized into the expected class.
|
||||
* The oneOf schema does not have a discriminator.
|
||||
*/
|
||||
@Test
|
||||
public void testOneOfSchemaWithoutDiscriminator() throws Exception {
|
||||
// BananaReq and AppleReq have explicitly defined properties that are different by name.
|
||||
// There is no discriminator property.
|
||||
String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false }";
|
||||
FruitReq o = json.getContext(null).readValue(str, FruitReq.class);
|
||||
assertTrue(o.getActualInstance() instanceof AppleReq);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a oneOf schema can be deserialized into the expected class.
|
||||
* The oneOf schema has a discriminator.
|
||||
*/
|
||||
@Test
|
||||
public void testOneOfSchemaWithDiscriminator() throws Exception {
|
||||
// Mammal can be one of whale, pig and zebra.
|
||||
// pig has sub-classes.
|
||||
String str = "{ \"className\": \"whale\", \"hasBaleen\": true, \"hasTeeth\": false }";
|
||||
/*
|
||||
DISABLING unit test for now until ambiguity of discriminator is resolved.
|
||||
|
||||
// Note that the 'zebra' schema does not have any explicit property defined AND
|
||||
// it has additionalProperties: true. Hence without a discriminator the above
|
||||
// JSON payload would match both 'whale' and 'zebra'. This is because the 'hasBaleen'
|
||||
// and 'hasTeeth' would be considered additional (undeclared) properties for 'zebra'.
|
||||
Mammal o = json.getContext(null).readValue(str, Mammal.class);
|
||||
assertTrue(o.getActualInstance() instanceof Whale);
|
||||
|
||||
str = "{ \"className\": \"zebra\" }";
|
||||
o = json.getContext(null).readValue(str, Mammal.class);
|
||||
assertTrue(o.getActualInstance() instanceof Zebra);
|
||||
|
||||
str = "{ \"className\": \"BasquePig\" }";
|
||||
o = json.getContext(null).readValue(str, Mammal.class);
|
||||
assertTrue(o.getActualInstance() instanceof BasquePig);
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -122,6 +122,7 @@ public class ApiClientTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore("There is no more basic auth in petstore security definitions")
|
||||
@Test
|
||||
public void testSetUsernameAndPassword() {
|
||||
HttpBasicAuth auth = null;
|
||||
|
||||
@@ -128,6 +128,7 @@ public class ApiClientTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Ignore("There is no more basic auth in petstore security definitions")
|
||||
@Test
|
||||
public void testSetUsernameAndPassword() {
|
||||
HttpBasicAuth auth = null;
|
||||
|
||||
13
README.md
13
README.md
@@ -44,7 +44,7 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
|
||||
[](https://www.namsor.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[](https://www.lightbow.net/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/docspring.png" width="128" height="128">](https://docspring.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/datadog.png" width="128" height="128">](https://datadoghq.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
|
||||
|
||||
#### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS and Checkly for sponsoring the API monitoring
|
||||
|
||||
@@ -283,7 +283,7 @@ To generate code with this image, you'll need to mount a local location as a vol
|
||||
Example:
|
||||
|
||||
```sh
|
||||
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
|
||||
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \
|
||||
-i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
|
||||
-g go \
|
||||
-o /local/out/go
|
||||
@@ -579,7 +579,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [Commencis](https://www.commencis.com/)
|
||||
- [Crossover Health](https://crossoverhealth.com/)
|
||||
- [Cupix](https://www.cupix.com/)
|
||||
- [Datadog](https://www.datadoghq.com)
|
||||
- [DB Systel](https://www.dbsystel.de)
|
||||
- [DocSpring](https://docspring.com/)
|
||||
- [dwango](https://dwango.co.jp/)
|
||||
@@ -746,11 +745,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- 2020-03-15 - [Load Testing Your API with Swagger/OpenAPI and k6](https://k6.io/blog/load-testing-your-api-with-swagger-openapi-and-k6)
|
||||
- 2020-04-13 - [俺的【OAS】との向き合い方 (爆速でOpenAPIと友達になろう)](https://tech-blog.optim.co.jp/entry/2020/04/13/100000) in [OPTim Blog](https://tech-blog.optim.co.jp/)
|
||||
- 2020-04-22 - [Introduction to OpenAPI Generator](https://nordicapis.com/introduction-to-openapi-generator/) by [Kristopher Sandoval](https://nordicapis.com/author/sandovaleffect/) in [Nordic APIs](https://nordicapis.com/)
|
||||
- 2020-04-27 - [How we use Open API v3 specification to auto-generate API documentation, code-snippets and clients](https://medium.com/pdf-generator-api/how-we-use-open-api-v3-specification-to-auto-generate-api-documentation-code-snippets-and-clients-d127a3cea784) by [Tanel Tähepõld](https://medium.com/@tanel.tahepold)
|
||||
- 2020-05-09 - [OpenAPIでお手軽にモックAPIサーバーを動かす](https://qiita.com/kasa_le/items/97ca6a8dd4605695c25c) by [Sachie Kamba](https://qiita.com/kasa_le)
|
||||
- 2020-05-18 - [Spring Boot REST with OpenAPI 3](https://dev.to/alfonzjanfrithz/spring-boot-rest-with-openapi-3-59jm) by [Alfonz Jan Frithz](https://dev.to/alfonzjanfrithz)
|
||||
- 2020-05-19 - [Dead Simple APIs with Open API](https://www.youtube.com/watch?v=sIaXmR6xRAw) by [Chris Tankersley](https://github.com/dragonmantank) at [Nexmo](https://developer.nexmo.com/)
|
||||
- 2020-05-22 - [TypeScript REST API Client](https://dev.to/unhurried/typescript-rest-api-client-4in3) by ["unhurried"](https://dev.to/unhurried)
|
||||
|
||||
## [6 - About Us](#table-of-contents)
|
||||
|
||||
@@ -780,7 +775,6 @@ Here is a list of template creators:
|
||||
* Bash: @bkryza
|
||||
* C: @PowerOfCreation @zhemant [:heart:](https://www.patreon.com/zhemant)
|
||||
* C++ REST: @Danielku15
|
||||
* C++ UE4: @Kahncode
|
||||
* C# (.NET 2.0): @who
|
||||
* C# (.NET Standard 1.3 ): @Gronsak
|
||||
* C# (.NET 4.5 refactored): @jimschubert [:heart:](https://www.patreon.com/jimschubert)
|
||||
@@ -824,7 +818,6 @@ Here is a list of template creators:
|
||||
* Perl: @wing328 [:heart:](https://www.patreon.com/wing328)
|
||||
* PHP (Guzzle): @baartosz
|
||||
* PowerShell: @beatcracker
|
||||
* PowerShell (refactored in 5.0.0): @wing328
|
||||
* Python-experimental: @spacether
|
||||
* R: @ramnov
|
||||
* Ruby (Faraday): @meganemura @dkliban
|
||||
@@ -964,7 +957,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| OCaml | @cgensoul (2019/08) |
|
||||
| Perl | @wing328 (2017/07) [:heart:](https://www.patreon.com/wing328) @yue9944882 (2019/06) |
|
||||
| PHP | @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09) [:heart:](https://www.patreon.com/ackintosh/overview), @ybelenko (2018/07), @renepardon (2018/12) |
|
||||
| PowerShell | @wing328 (2020/05) |
|
||||
| PowerShell | |
|
||||
| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11) |
|
||||
| R | @Ramanth (2019/07) @saigiridhar21 (2019/07) |
|
||||
| Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
|
||||
|
||||
@@ -32,7 +32,7 @@ install:
|
||||
- git clone https://github.com/wing328/swagger-samples
|
||||
- ps: Start-Process -FilePath 'C:\maven\apache-maven-3.2.5\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci"
|
||||
- ps: $PSVersionTable.PSVersion
|
||||
- ps: Install-Module Pester -Force -Scope CurrentUser -RequiredVersion 4.3.1
|
||||
- ps: Install-Module Pester -Force -Scope CurrentUser
|
||||
build_script:
|
||||
- dotnet --info
|
||||
# build C# API client (netcore)
|
||||
@@ -48,9 +48,9 @@ build_script:
|
||||
- nuget restore samples\client\petstore\csharp\OpenAPIClientNetStandard\Org.OpenAPITools.sln
|
||||
- msbuild samples\client\petstore\csharp\OpenAPIClientNetStandard\Org.OpenAPITools.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
# install openapi-generator locally
|
||||
- mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn clean install --quiet -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
# run the locally installed openapi-generator-gradle-plugin
|
||||
- gradle -b modules\openapi-generator-gradle-plugin\samples\local-spec\build.gradle buildGoSdk --stacktrace
|
||||
- gradle -b modules\openapi-generator-gradle-plugin\samples\local-spec\build.gradle buildGoSdk --info
|
||||
test_script:
|
||||
# restore test-related files
|
||||
- copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/apex -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g apex -o samples/client/petstore/apex --global-property skipFormModel=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/apex -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g apex -o samples/client/petstore/apex $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/feign",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/feign",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true,
|
||||
"booleanGetterPrefix": "is",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/feign10x",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/feign",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true,
|
||||
"booleanGetterPrefix": "is"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/google-api-client",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/google-api-client",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/native",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/native",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/okhttp-gson-parcelableModel",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true,
|
||||
"parcelableModel": true
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/okhttp-gson",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/feign",
|
||||
"outputDir": "samples/client/petstore/java/feign10x",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/rest-assured-jackson",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/rest-assured",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true,
|
||||
"booleanGetterPrefix": "is",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/rest-assured",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/rest-assured",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true,
|
||||
"booleanGetterPrefix": "is"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/retrofit2",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/retrofit2",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/retrofit2rx",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/retrofit2",
|
||||
"additionalProperties": {
|
||||
"useRxJava": true,
|
||||
"hideGenerationTimestamp": true
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/retrofit2rx2",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/retrofit2",
|
||||
"additionalProperties": {
|
||||
"useRxJava2": true,
|
||||
"hideGenerationTimestamp": true
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"generatorName": "java",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/java/vertx",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/Java/libraries/vertx",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
|
||||
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 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 -t modules/openapi-generator/src/main/resources/cpp-ue4 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-ue4 -o samples/client/petstore/cpp-ue4"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -6,7 +6,7 @@
|
||||
# C# Petstore API client with PropertyChanged
|
||||
./bin/csharp-property-changed-petstore.sh
|
||||
|
||||
# C# Petstore API client (.net standarnd 1.3+)
|
||||
# C# Petstore API client (v5.0 for .net standarnd 1.3+)
|
||||
./bin/csharp-petstore-net-standard.sh
|
||||
|
||||
# C# Petstore API client (.NET 4.0)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"targetFramework": "netstandard1.3"
|
||||
"targetFramework": "v5.0"
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
SPEC="modules/openapi-generator/src/test/resources/3_0/petstore.yaml"
|
||||
SPEC="modules/openapi-generator/src/test/resources/2_0/petstore.yaml"
|
||||
GENERATOR="go-gin-server"
|
||||
STUB_DIR="samples/server/petstore/go-gin-api-server"
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
SPEC="modules/openapi-generator/src/test/resources/3_0/petstore.yaml"
|
||||
SPEC="modules/openapi-generator/src/test/resources/2_0/petstore.yaml"
|
||||
GENERATOR="go-server"
|
||||
STUB_DIR="samples/server/petstore/go-api-server"
|
||||
|
||||
|
||||
@@ -27,5 +27,5 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Groovy/ -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g groovy -o samples/client/petstore/groovy --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Groovy/ -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g groovy -o samples/client/petstore/groovy --additional-properties hideGenerationTimestamp=true $@"
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
# update java petstore clients for all supported http libraries
|
||||
|
||||
./bin/java-petstore-feign-10x.sh
|
||||
./bin/java-petstore-feign.sh
|
||||
./bin/java-petstore-google-api-client.sh
|
||||
./bin/java-petstore-jersey1.sh
|
||||
./bin/java-petstore-jersey2-java6.sh
|
||||
./bin/java-petstore-jersey2-java7.sh
|
||||
./bin/java-petstore-jersey2-java8.sh
|
||||
./bin/java-petstore-microprofile.sh
|
||||
./bin/java-petstore-native.sh
|
||||
@@ -14,6 +17,7 @@
|
||||
./bin/java-petstore-resteasy.sh
|
||||
./bin/java-petstore-resttemplate-withxml.sh
|
||||
./bin/java-petstore-resttemplate.sh
|
||||
./bin/java-petstore-retrofit.sh
|
||||
./bin/java-petstore-retrofit2-play24.sh
|
||||
./bin/java-petstore-retrofit2-play25.sh
|
||||
./bin/java-petstore-retrofit2-play26.sh
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-feign-10x.json -o samples/client/petstore/java/feign10x --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/feign -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-feign-10x.json -o samples/client/petstore/java/feign10x --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/feign10x/src/main"
|
||||
rm -rf samples/client/petstore/java/feign10x/src/main
|
||||
|
||||
5
bin/java-petstore-feign-9x.json
Normal file
5
bin/java-petstore-feign-9x.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"library": "feign",
|
||||
"artifactId": "petstore-feign",
|
||||
"feignVersion": "9.x"
|
||||
}
|
||||
5
bin/java-petstore-feign.json
Normal file
5
bin/java-petstore-feign.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"library": "feign",
|
||||
"artifactId": "petstore-feign",
|
||||
"feignVersion": "10.x"
|
||||
}
|
||||
40
bin/java-petstore-feign.sh
Executable file
40
bin/java-petstore-feign.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/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} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/feign -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-feign-9x.json -o samples/client/petstore/java/feign --additional-properties hideGenerationTimestamp=true,booleanGetterPrefix=is,additionalModelTypeAnnotations=@javax.annotation.concurrent.Immutable $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/feign/src/main"
|
||||
rm -rf samples/client/petstore/java/feign/src/main
|
||||
find samples/client/petstore/java/feign -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
# copy additional manually written unit-tests
|
||||
mkdir samples/client/petstore/java/feign/src/test/java/org/openapitools/client
|
||||
|
||||
cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/feign/src/test/java/org/openapitools/client/StringUtilTest.java
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-google-api-client.json -o samples/client/petstore/java/google-api-client --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/google-api-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-google-api-client.json -o samples/client/petstore/java/google-api-client --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/google-api-client/src/main"
|
||||
rm -rf samples/client/petstore/java/google-api-client/src/main
|
||||
|
||||
39
bin/java-petstore-jersey2-java6.sh
Executable file
39
bin/java-petstore-jersey2-java6.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/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} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate --artifact-id petstore-jersey2-java6 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples/client/petstore/java/jersey2-java6 --additional-properties hideGenerationTimestamp=true,supportJava6=true,booleanGetterPrefix=is $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/jersey2-java6/src/main"
|
||||
rm -rf samples/client/petstore/java/jersey2-java6/src/main
|
||||
find samples/client/petstore/java/jersey2-java6 -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||
|
||||
echo "Restoring build.gradle ... "
|
||||
cp CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle samples/client/petstore/java/jersey2-java6/
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
5
bin/java-petstore-jersey2-java7.json
Normal file
5
bin/java-petstore-jersey2-java7.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"library": "jersey2",
|
||||
"java8": false,
|
||||
"artifactId": "petstore-jersey2-java7"
|
||||
}
|
||||
48
bin/java-petstore-jersey2-java7.sh
Executable file
48
bin/java-petstore-jersey2-java7.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/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} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-jersey2-java7.json -o samples/client/petstore/java/jersey2-java7 --additional-properties java8=false,hideGenerationTimestamp=true $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/jersey2/src/main"
|
||||
rm -rf samples/client/petstore/java/jersey2/src/main
|
||||
find samples/client/petstore/java/jersey2 -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
# copy additional manually written unit-tests
|
||||
#mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client
|
||||
#mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth
|
||||
#mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model
|
||||
#
|
||||
#cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/StringUtilTest.java
|
||||
#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ApiClientTest.java
|
||||
#cp CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ConfigurationTest.java
|
||||
#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java
|
||||
#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java
|
||||
#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumValueTest.java
|
||||
#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/JSONTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/JSONTest.java
|
||||
@@ -35,9 +35,9 @@ find samples/client/petstore/java/jersey2-java8 -maxdepth 1 -type f ! -name "REA
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
# copy additional manually written unit-tests
|
||||
mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client
|
||||
mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth
|
||||
mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model
|
||||
mkdir samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client
|
||||
mkdir samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth
|
||||
mkdir samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model
|
||||
|
||||
cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/StringUtilTest.java
|
||||
cp CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/ApiClientTest.java
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-native.json -o samples/client/petstore/java/native-async --additional-properties hideGenerationTimestamp=true,asyncNative=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/native -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-native.json -o samples/client/petstore/java/native-async --additional-properties hideGenerationTimestamp=true,asyncNative=true $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/httpclient/src/main"
|
||||
rm -rf samples/client/petstore/java/native-async/src/main
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-native.json -o samples/client/petstore/java/native --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/native -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-native.json -o samples/client/petstore/java/native --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/httpclient/src/main"
|
||||
rm -rf samples/client/petstore/java/native/src/main
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate --artifact-id petstore-okhttp-gson-parcelableModel -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson-parcelableModel --additional-properties hideGenerationTimestamp=true,parcelableModel=true $@"
|
||||
ags="generate --artifact-id petstore-okhttp-gson-parcelableModel -t modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson-parcelableModel --additional-properties hideGenerationTimestamp=true,parcelableModel=true $@"
|
||||
|
||||
rm -rf samples/client/petstore/java/okhttp-gson-parcelableModel/src/main
|
||||
find samples/client/petstore/java/okhttp-gson-parcelableModel -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-okhttp-gson.json -o samples/client/petstore/java/okhttp-gson --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
rm -rf samples/client/petstore/java/okhttp-gson/src/main
|
||||
find samples/client/petstore/java/okhttp-gson -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||
|
||||
@@ -28,7 +28,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
args="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-rest-assured-jackson.json -o ${target_dir} --additional-properties hideGenerationTimestamp=true --additional-properties useBeanValidation=true --additional-properties performBeanValidation=true --additional-properties booleanGetterPrefix=is --additional-properties java8=true --additional-properties dateLibrary=java8 --additional-properties serializationLibrary=jackson $@"
|
||||
args="generate -t modules/openapi-generator/src/main/resources/Java/libraries/rest-assured -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-rest-assured-jackson.json -o ${target_dir} --additional-properties hideGenerationTimestamp=true --additional-properties useBeanValidation=true --additional-properties performBeanValidation=true --additional-properties booleanGetterPrefix=is --additional-properties java8=true --additional-properties dateLibrary=java8 --additional-properties serializationLibrary=jackson $@"
|
||||
|
||||
echo "Removing ${target_dir}"
|
||||
rm -rf "${target_dir}"
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-rest-assured.json -o samples/client/petstore/java/rest-assured --additional-properties hideGenerationTimestamp=true --additional-properties useBeanValidation=true --additional-properties performBeanValidation=true --additional-properties booleanGetterPrefix=is $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/rest-assured -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-rest-assured.json -o samples/client/petstore/java/rest-assured --additional-properties hideGenerationTimestamp=true --additional-properties useBeanValidation=true --additional-properties performBeanValidation=true --additional-properties booleanGetterPrefix=is $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/rest-assured/src/main"
|
||||
rm -rf samples/client/petstore/java/rest-assured/src/main
|
||||
|
||||
4
bin/java-petstore-retrofit.json
Normal file
4
bin/java-petstore-retrofit.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"library": "retrofit",
|
||||
"artifactId": "petstore-retrofit"
|
||||
}
|
||||
35
bin/java-petstore-retrofit.sh
Executable file
35
bin/java-petstore-retrofit.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/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} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit.json -o samples/client/petstore/java/retrofit --additional-properties hideGenerationTimestamp=true,dateLibrary=joda $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/retrofit/src/main"
|
||||
rm -rf samples/client/petstore/java/retrofit/src/main
|
||||
find samples/client/petstore/java/retrofit -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2.json -o samples/client/petstore/java/retrofit2 --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/retrofit2 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2.json -o samples/client/petstore/java/retrofit2 --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/retrofit2/src/main"
|
||||
rm -rf samples/client/petstore/java/retrofit2/src/main
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2rx.json -o samples/client/petstore/java/retrofit2rx --additional-properties useRxJava=true,hideGenerationTimestamp=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/retrofit2 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2rx.json -o samples/client/petstore/java/retrofit2rx --additional-properties useRxJava=true,hideGenerationTimestamp=true $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/retrofit2rx/src/main"
|
||||
rm -rf samples/client/petstore/java/retrofit2rx/src/main
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2rx2.json -o samples/client/petstore/java/retrofit2rx2 --additional-properties useRxJava2=true,hideGenerationTimestamp=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/retrofit2 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-retrofit2rx2.json -o samples/client/petstore/java/retrofit2rx2 --additional-properties useRxJava2=true,hideGenerationTimestamp=true $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/retrofit2rx2/src/main"
|
||||
rm -rf samples/client/petstore/java/retrofit2rx2/src/main
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-vertx.json -o samples/client/petstore/java/vertx --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Java/libraries/vertx -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-vertx.json -o samples/client/petstore/java/vertx --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/vertx/src/main"
|
||||
rm -rf samples/client/petstore/java/vertx/src/main
|
||||
|
||||
@@ -28,7 +28,8 @@ fi
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Javascript/es6 \
|
||||
-i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript \
|
||||
-o samples/client/petstore/javascript-es6 --additional-properties appName=PetstoreClient $@"
|
||||
-i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript \
|
||||
--additional-properties appName=PetstoreClient \
|
||||
-o samples/client/petstore/javascript-es6 $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
./bin/javascript-petstore.sh
|
||||
./bin/javascript-promise-petstore.sh
|
||||
./bin/javascript-es6-petstore.sh
|
||||
./bin/javascript-promise-es6-petstore.sh
|
||||
|
||||
32
bin/javascript-petstore.sh
Executable file
32
bin/javascript-petstore.sh
Executable file
@@ -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} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Javascript -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript -o samples/client/petstore/javascript --additional-properties appName=PetstoreClient,useES6=false $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -28,8 +28,8 @@ fi
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Javascript/es6 \
|
||||
-i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript \
|
||||
-i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript \
|
||||
-o samples/client/petstore/javascript-promise-es6 \
|
||||
--additional-properties appName=PetstoreClient,usePromises=true $@"
|
||||
--additional-properties appName=PetstoreClient,usePromises=true,useES6=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
38
bin/javascript-promise-petstore.sh
Executable file
38
bin/javascript-promise-petstore.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/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} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate \
|
||||
-t modules/openapi-generator/src/main/resources/Javascript \
|
||||
-i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml \
|
||||
-g javascript \
|
||||
-o samples/client/petstore/javascript-promise \
|
||||
--additional-properties usePromises=true,useES6=false \
|
||||
--additional-properties appName=PetstoreClient $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -12,4 +12,3 @@
|
||||
./bin/kotlin-client-nullable.sh
|
||||
./bin/kotlin-client-retrofit2.sh
|
||||
./bin/kotlin-client-json-request-string.sh
|
||||
./bin/kotlin-client-petstore-okhttp-coroutines.sh
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/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 clean package
|
||||
fi
|
||||
|
||||
samplePath="samples/client/petstore/kotlin-jvm-okhttp4-coroutines"
|
||||
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-okhttp4-coroutines-client --library jvm-okhttp4 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useCoroutines=true -o $samplePath $@"
|
||||
|
||||
echo "Cleaning previously generated files if any from $samplePath"
|
||||
rm -rf $samplePath
|
||||
|
||||
echo "Generating Kotling client..."
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/nodejs-express-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-express-server -o samples/server/petstore/nodejs-express-server $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/nodejs-express-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g nodejs-express-server -o samples/server/petstore/nodejs-express-server -Dservice $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -28,7 +28,7 @@ fi
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
|
||||
args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ocaml -o samples/client/petstore/ocaml --additional-properties packageName=petstore_client $@"
|
||||
args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ocaml -o samples/client/petstore/ocaml --additional-properties packageName=petstore_client $@"
|
||||
|
||||
echo "java ${JAVA_OPTS} -jar ${executable} ${args}"
|
||||
java $JAVA_OPTS -jar $executable $args
|
||||
|
||||
31
bin/openapi3/groovy-petstore.sh
Executable file
31
bin/openapi3/groovy-petstore.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/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 clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g groovy -o samples/client/petstore/groovy --additional-properties hideGenerationTimestamp=true $@"
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"library": "jersey2",
|
||||
"artifactId": "petstore-openapi3-jersey2-java8",
|
||||
"dateLibrary": "java8"
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/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} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
yaml="modules/openapi-generator/src/test/resources/3_0/python-experimental/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml"
|
||||
ags="generate --artifact-id petstore-openapi3-jersey2-java8 -i $yaml -g java -c bin/openapi3/java-petstore-jersey2-java8.json -o samples/openapi3/client/petstore/java/jersey2-java8 --additional-properties hideGenerationTimestamp=true --additional-properties serverPort=8082 $@"
|
||||
|
||||
echo "Removing files and folders under samples/openapi3/client/petstore/java/jersey2-java8/src/main"
|
||||
rm -rf samples/openapi3/client/petstore/java/jersey2-java8/src/main
|
||||
find samples/openapi3/client/petstore/java/jersey2-java8 -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
# copy additional manually written unit-tests
|
||||
mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client
|
||||
mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/auth
|
||||
mkdir -p samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model
|
||||
|
||||
cp CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONTest.java samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONTest.java
|
||||
cp CI/samples.ci/client/petstore/java/test-manual/jersey2-java8/JSONComposedSchemaTest.java samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java
|
||||
34
bin/openapi3/javascript-es6-petstore.sh
Executable file
34
bin/openapi3/javascript-es6-petstore.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/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} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/Javascript/es6 \
|
||||
-i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g javascript \
|
||||
-o samples/openapi3/client/petstore/javascript-es6 --additional-properties appName=PetstoreClient $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -7,3 +7,4 @@
|
||||
./bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh
|
||||
./bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh
|
||||
./bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh
|
||||
|
||||
|
||||
34
bin/openapi3/ocaml-client-petstore.sh
Executable file
34
bin/openapi3/ocaml-client-petstore.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/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} -Xmx1024M -DdebugOperations -DloggerPath=conf/log4j.properties"
|
||||
|
||||
args="generate -t modules/openapi-generator/src/main/resources/ocaml -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ocaml -o samples/openapi3/client/petstore/ocaml/ --additional-properties packageName=petstore_client $@"
|
||||
|
||||
echo "java ${JAVA_OPTS} -jar ${executable} ${args}"
|
||||
java $JAVA_OPTS -jar $executable $args
|
||||
43
bin/openapi3/ruby-client-faraday-petstore.sh
Executable file
43
bin/openapi3/ruby-client-faraday-petstore.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/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 clean package
|
||||
fi
|
||||
|
||||
# purge lib/doc folder
|
||||
echo "purge ruby petstore lib, docs folder"
|
||||
rm -Rf samples/openapi3/client/petstore/ruby-faraday/lib
|
||||
rm -Rf samples/openapi3/client/petstore/ruby-faraday/docs
|
||||
|
||||
# purge test files other than integration test
|
||||
# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files
|
||||
echo "purge ruby petstore spec"
|
||||
find samples/openapi3/client/petstore/ruby-faraday/spec -type d -not -name spec -not -name custom | xargs rm -Rf
|
||||
find samples/openapi3/client/petstore/ruby-faraday/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/openapi3/ruby-petstore-faraday.json -o samples/openapi3/client/petstore/ruby-faraday --additional-properties skipFormModel=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
43
bin/openapi3/ruby-client-petstore.sh
Executable file
43
bin/openapi3/ruby-client-petstore.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/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 clean package
|
||||
fi
|
||||
|
||||
# purge lib/doc folder
|
||||
echo "purge ruby petstore lib, docs folder"
|
||||
rm -Rf samples/openapi3/client/petstore/ruby/lib
|
||||
rm -Rf samples/openapi3/client/petstore/ruby/docs
|
||||
|
||||
# purge test files other than integration test
|
||||
# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files
|
||||
echo "purge ruby petstore spec"
|
||||
find samples/openapi3/client/petstore/ruby/spec -type d -not -name spec -not -name custom | xargs rm -Rf
|
||||
find samples/openapi3/client/petstore/ruby/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/openapi3/client/petstore/ruby --additional-properties skipFormModel=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/openapi3/ruby-on-rails-server-petstore.sh
Executable file
32
bin/openapi3/ruby-on-rails-server-petstore.sh
Executable file
@@ -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 clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
6
bin/openapi3/ruby-petstore-faraday.json
Normal file
6
bin/openapi3/ruby-petstore-faraday.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"gemName": "petstore",
|
||||
"moduleName": "Petstore",
|
||||
"library": "faraday",
|
||||
"gemVersion": "1.0.0"
|
||||
}
|
||||
32
bin/openapi3/ruby-sinatra-server-petstore.sh
Executable file
32
bin/openapi3/ruby-sinatra-server-petstore.sh
Executable file
@@ -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 clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/openapi3/scala-akka-petstore.sh
Executable file
32
bin/openapi3/scala-akka-petstore.sh
Executable file
@@ -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 clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/3_0/scala-akka/petstore.yaml -g scala-akka -o samples/openapi3/client/petstore/scala-akka $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/openapi3/scala-httpclient-petstore.sh
Executable file
32
bin/openapi3/scala-httpclient-petstore.sh
Executable file
@@ -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 clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scala-httpclient -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-httpclient-deprecated -o samples/client/petstore/scala-httpclient $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate --artifact-id 'scala-sttp-petstore' -t modules/openapi-generator/src/main/resources/scala-sttp -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-sttp -o samples/client/petstore/scala-sttp $@"
|
||||
ags="generate --artifact-id 'scala-sttp-petstore' -t modules/openapi-generator/src/main/resources/scala-sttp -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-sttp -o samples/openapi3/client/petstore/scala-sttp $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/openapi3/scalatra-petstore-server.sh
Executable file
32
bin/openapi3/scalatra-petstore-server.sh
Executable file
@@ -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 clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scalatra -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scalatra -o samples/server/petstore/scalatra $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/openapi3/scalaz-petstore.sh
Executable file
32
bin/openapi3/scalaz-petstore.sh
Executable file
@@ -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 clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scalaz -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scalaz -o samples/client/petstore/scalaz $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -28,6 +28,6 @@ fi
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
# complex module name used for testing
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g perl -o samples/client/petstore/perl --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g perl -o samples/client/petstore/perl --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/client/petstore/python-experimental --additional-properties packageName=petstore_api --additional-properties disallowAdditionalPropertiesIfNotPresent=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/client/petstore/python-experimental --additional-properties packageName=petstore_api $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -37,8 +37,8 @@ ags="generate -t $resources -i $input -g $generator -o $out_folder $@"
|
||||
rm -rf $out_folder/.openapi*
|
||||
rm -rf $out_folder/openapi_server
|
||||
rm -rf $out_folder/tests*
|
||||
rm -f $out_folder/README.md
|
||||
rm -f $out_folder/requirements.txt
|
||||
rm -f $out_folder/test-requirements.txt
|
||||
rm $out_folder/README.md
|
||||
rm $out_folder/requirements.txt
|
||||
rm $out_folder/test-requirements.txt
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -22,22 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# purge lib/doc folder
|
||||
echo "purge ruby petstore lib, docs folder"
|
||||
rm -Rf samples/client/petstore/ruby-faraday/lib
|
||||
rm -Rf samples/client/petstore/ruby-faraday/docs
|
||||
|
||||
# purge test files other than integration test
|
||||
# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files
|
||||
echo "purge ruby petstore spec"
|
||||
find samples/client/petstore/ruby-faraday/spec -type d -not -name spec -not -name custom | xargs rm -Rf
|
||||
find samples/client/petstore/ruby-faraday/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore-faraday.json -o samples/client/petstore/ruby-faraday --global-property skipFormModel=true $@"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore-faraday.json -o samples/client/petstore/ruby-faraday $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -22,22 +22,16 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# purge lib/doc folder
|
||||
echo "purge ruby petstore lib, docs folder"
|
||||
echo "purge ruby petstore lib, docs, spec folder"
|
||||
rm -Rf samples/client/petstore/ruby/lib
|
||||
rm -Rf samples/client/petstore/ruby/docs
|
||||
|
||||
# purge test files other than integration test
|
||||
# NOTE: spec/custom/*.rb and spec/petstore_helper.rb are not generated files
|
||||
echo "purge ruby petstore spec"
|
||||
find samples/client/petstore/ruby/spec -type d -not -name spec -not -name custom | xargs rm -Rf
|
||||
find samples/client/petstore/ruby/spec -type f -not -name petstore_helper.rb -not -iwholename '*/spec/custom/*' | xargs rm -Rf
|
||||
rm -Rf samples/client/petstore/ruby/spec
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby --global-property skipFormModel=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
"gemName": "petstore",
|
||||
"moduleName": "Petstore",
|
||||
"library": "faraday",
|
||||
"gemVersion": "1.0.0"
|
||||
"gemVersion": "1.0.0",
|
||||
"strictSpecBehavior": false
|
||||
}
|
||||
|
||||
@@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/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} -Xmx1024M -DloggerPath=conf/log4j.properties $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/rust -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g rust --library reqwest -o samples/client/petstore/rust/reqwest/petstore-async --additional-properties supportAsync=true,packageName=petstore-reqwest-async $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -40,7 +40,7 @@ for spec_path in \
|
||||
--input-spec $spec_path
|
||||
--generator-name rust
|
||||
--output samples/client/petstore/rust/$library/$spec
|
||||
--additional-properties packageName=${spec}-${library},supportAsync=false
|
||||
--additional-properties packageName=${spec}-${library}
|
||||
--library=$library $@"
|
||||
java ${JAVA_OPTS} -jar ${executable} ${args} || exit 1
|
||||
done
|
||||
|
||||
@@ -26,6 +26,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-akka-http-server -o samples/server/petstore/scala-akka-http-server $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-akka-http-server -o samples/server/petstore/scala-akka-http-server $@"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
||||
|
||||
@@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/3_0/scala-akka/petstore.yaml -g scala-akka -o samples/client/petstore/scala-akka $@"
|
||||
ags="generate --artifact-id "scala-akka-petstore-client" -t modules/openapi-generator/src/main/resources/scala-akka-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-akka -o samples/client/petstore/scala-akka $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scala-finch -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-finch -o samples/server/petstore/scala-finch --global-property skipFormModel=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scala-finch -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-finch -o samples/server/petstore/scala-finch $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scala-gatling -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-gatling -o samples/client/petstore/scala-gatling $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scala-gatling -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-gatling -o samples/client/petstore/scala-gatling $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scala-httpclient -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-httpclient-deprecated -o samples/client/petstore/scala-httpclient $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scala-httpclient -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-httpclient-deprecated -o samples/client/petstore/scala-httpclient $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scala-lagom-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-lagom-server -o samples/server/petstore/scala-lagom-server --global-property skipFormModel=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scala-lagom-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-lagom-server -o samples/server/petstore/scala-lagom-server $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scala-play-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scala-play-server -o samples/server/petstore/scala-play-server --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scala-play-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scala-play-server -o samples/server/petstore/scala-play-server --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scalatra -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scalatra -o samples/server/petstore/scalatra $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scalatra -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scalatra -o samples/server/petstore/scalatra $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -22,11 +22,11 @@ executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scalaz -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g scalaz -o samples/client/petstore/scalaz --global-property skipFormModel=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/scalaz -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g scalaz -o samples/client/petstore/scalaz $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
./bin/typescript-angular-v2-petstore.sh
|
||||
./bin/typescript-angular-v2-petstore-with-npm.sh
|
||||
./bin/typescript-angular-v2-petstore-interfaces.sh
|
||||
./bin/typescript-angular-v4-petstore-with-npm.sh
|
||||
./bin/typescript-angular-v4.3-petstore-with-npm.sh
|
||||
./bin/typescript-angular-v6-petstore-not-provided-in-root.sh
|
||||
./bin/typescript-angular-v6-petstore-not-provided-in-root-with-npm.sh
|
||||
./bin/typescript-angular-v6-petstore-provided-in-root.sh
|
||||
|
||||
32
bin/typescript-angular-v2-petstore-interfaces.sh
Executable file
32
bin/typescript-angular-v2-petstore-interfaces.sh
Executable file
@@ -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} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-angular -o samples/client/petstore/typescript-angular-v2/with-interfaces --additional-properties ngVersion=2,withInterfaces=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user