forked from loafle/openapi-generator-original
Compare commits
58 Commits
v4.2.2
...
typescript
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3f5fef279 | ||
|
|
6dfe637b21 | ||
|
|
a738e95aee | ||
|
|
9d08f8bc5b | ||
|
|
9e49c7e942 | ||
|
|
bc734da7d4 | ||
|
|
abff890b90 | ||
|
|
b796270880 | ||
|
|
02c1d9ff64 | ||
|
|
7d69d0b9cb | ||
|
|
3e94fd15cc | ||
|
|
491fae4c25 | ||
|
|
be3e24b681 | ||
|
|
7d0b3e1879 | ||
|
|
8b138ecd81 | ||
|
|
496c0c8bdc | ||
|
|
b8e31fcddd | ||
|
|
64b8505010 | ||
|
|
5f163da848 | ||
|
|
7f5615485d | ||
|
|
e700a08a8f | ||
|
|
74bb8ccfe7 | ||
|
|
01b0ff6008 | ||
|
|
5323a5d7a6 | ||
|
|
8c03ea8ca5 | ||
|
|
c90c3f9d7b | ||
|
|
9c17bc5721 | ||
|
|
a0e3f18f2f | ||
|
|
647474f3d9 | ||
|
|
4720467cbb | ||
|
|
2468b748d3 | ||
|
|
9a9e62cfa5 | ||
|
|
5174e7539b | ||
|
|
fe0cb07afb | ||
|
|
878ea6e1c1 | ||
|
|
69dfdd57a6 | ||
|
|
502e209bfe | ||
|
|
8d29ca42d5 | ||
|
|
49219fa48a | ||
|
|
f4b3eb011b | ||
|
|
ef065f3013 | ||
|
|
29940ef0b1 | ||
|
|
dd7d8c0271 | ||
|
|
0da5238e24 | ||
|
|
2e8446ceee | ||
|
|
662242157f | ||
|
|
5adefaf53f | ||
|
|
8dca5e4cbe | ||
|
|
e21a48dd64 | ||
|
|
894bddac1b | ||
|
|
fe2cc24f4d | ||
|
|
b0f8dc9505 | ||
|
|
8f82cdec7d | ||
|
|
64f29483ce | ||
|
|
94432cff92 | ||
|
|
3e745b71f2 | ||
|
|
f90e1b59f5 | ||
|
|
dd6835393d |
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -6,5 +6,5 @@
|
||||
- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
|
||||
- [ ] If contributing template-only or documentation-only changes which will change sample output, [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) before.
|
||||
- [ ] Run the shell script(s) under `./bin/` (or Windows batch scripts under`.\bin\windows`) to update Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run `./bin/{LANG}-petstore.sh`, `./bin/openapi3/{LANG}-petstore.sh` if updating the code or mustache templates for a language (`{LANG}`) (e.g. php, ruby, python, etc).
|
||||
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `4.3.x`, `5.0.x`. Default: `master`.
|
||||
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `4.1.x`, `5.0.x`. Default: `master`.
|
||||
- [ ] Copy the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) to review the pull request if your PR is targeting a particular programming language.
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -7,6 +7,7 @@ out/
|
||||
classpath.txt
|
||||
version.properties
|
||||
modules/openapi-generator-gradle-plugin/bin/
|
||||
modules/openapi-generator-cli/bin/
|
||||
!modules/openapi-generator-cli/src/main/resources/version.properties
|
||||
.project
|
||||
.classpath
|
||||
|
||||
@@ -20,6 +20,7 @@ cache:
|
||||
- $HOME/samples/client/petstore/php/OpenAPIToolsClient-php/vendor
|
||||
- $HOME/samples/client/petstore/ruby/vendor/bundle
|
||||
- $HOME/samples/client/petstore/python/.venv/
|
||||
- $HOME/samples/client/petstore/typescript/tests/default/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
|
||||
@@ -62,7 +63,7 @@ before_install:
|
||||
- gem install bundler
|
||||
- npm install -g typescript
|
||||
- npm install -g npm
|
||||
#- npm install -g elm@0.18.0-exp5
|
||||
- npm install -g elm@0.18.0-exp5
|
||||
- npm config set registry http://registry.npmjs.org/
|
||||
# set python 3.6.3 as default
|
||||
- source ~/virtualenv/python3.6/bin/activate
|
||||
@@ -138,8 +139,6 @@ script:
|
||||
# test maven plugin
|
||||
- mvn clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml
|
||||
- mvn clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml
|
||||
- mvn clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml
|
||||
- mvn clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml
|
||||
# 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)
|
||||
|
||||
@@ -2,17 +2,6 @@ kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
# test ocaml petstore client
|
||||
- name: ocaml-test
|
||||
image: ocaml/opam2:4.07
|
||||
commands:
|
||||
- sudo apt-get -y install m4
|
||||
- cd samples/client/petstore/ocaml
|
||||
- opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix
|
||||
- opam pin add ocaml-migrate-parsetree 1.3.1
|
||||
- eval $(opam env)
|
||||
- sudo chmod -R 777 .
|
||||
- dune build --build-dir=./_build
|
||||
# test haskell client
|
||||
- name: haskell-client-test
|
||||
image: haskell:8.6.5
|
||||
@@ -39,3 +28,13 @@ steps:
|
||||
- /bin/bash bin/run-all-petstore
|
||||
# generate all petstore samples (openapi3)
|
||||
- /bin/bash bin/openapi3/run-all-petstore
|
||||
# test ocaml petstore client
|
||||
- name: ocaml-test
|
||||
image: ocaml/opam2:4.07
|
||||
commands:
|
||||
- sudo apt-get -y install m4
|
||||
- cd samples/client/petstore/ocaml
|
||||
- opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix
|
||||
- eval $(opam env)
|
||||
- sudo chmod -R 777 .
|
||||
- dune build --build-dir=./_build
|
||||
|
||||
@@ -1,25 +1,55 @@
|
||||
sudo: required
|
||||
language: objective-c
|
||||
osx_image: xcode10.3
|
||||
osx_image: xcode8.1
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
- $HOME/.ivy2
|
||||
- $HOME/.gradle/caches/
|
||||
- $HOME/.gradle/wrapper/
|
||||
- $HOME/.stack
|
||||
- $HOME/samples/client/petstore/php/OpenAPIToolsClient-php/vendor
|
||||
- $HOME/samples/client/petstore/ruby/venodr/bundle
|
||||
- $HOME/samples/client/petstore/python/.venv/
|
||||
- $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
|
||||
- $HOME/samples/client/petstore/typescript-fetch/tests/default/typings
|
||||
- $HOME/samples/client/petstore/typescript-fetch/builds/default/node_modules
|
||||
- $HOME/samples/client/petstore/typescript-fetch/builds/default/typings
|
||||
- $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/node_modules
|
||||
- $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/typings
|
||||
- $HOME/samples/client/petstore/typescript-fetch/builds/with-npm-version/node_modules
|
||||
- $HOME/samples/client/petstore/typescript-fetch/npm/with-npm-version/typings
|
||||
- $HOME/samples/client/petstore/typescript-angularjs/node_modules
|
||||
- $HOME/samples/client/petstore/typescript-angularjs/typings
|
||||
- $HOME/.cocoapods/repos/master
|
||||
timeout: 1000
|
||||
|
||||
# comment out the host table change to use the public petstore server
|
||||
addons:
|
||||
hosts:
|
||||
- petstore.swagger.io
|
||||
|
||||
before_install:
|
||||
- export SW=`pwd`
|
||||
- rvm list
|
||||
#- rvm use 2.3.3
|
||||
- rvm use 2.3.3
|
||||
- gem environment
|
||||
- gem install bundler -N
|
||||
- gem install cocoapods -v 1.2.1 -N
|
||||
- gem install xcpretty -N
|
||||
- gem install bundler -N --no-ri --no-rdoc
|
||||
- gem install cocoapods -v 1.2.1 -N --no-ri --no-rdoc
|
||||
- gem install xcpretty -N --no-ri --no-rdoc
|
||||
- pod --version
|
||||
# comment out below to avoid errors
|
||||
#- pod repo update
|
||||
#- pod setup --silent > /dev/null
|
||||
#- mkdir -p ~/.local/bin
|
||||
#- export PATH=$HOME/.local/bin:$PATH
|
||||
## start local petstore server
|
||||
#- git clone -b docker --single-branch https://github.com/wing328/swagger-samples
|
||||
#- cd swagger-samples/java/java-jersey-jaxrs
|
||||
#- sudo mvn jetty:run &
|
||||
#- cd $SW
|
||||
- pod setup --silent > /dev/null
|
||||
- mkdir -p ~/.local/bin
|
||||
- export PATH=$HOME/.local/bin:$PATH
|
||||
# start local petstore server
|
||||
- git clone -b docker --single-branch https://github.com/wing328/swagger-samples
|
||||
- cd swagger-samples/java/java-jersey-jaxrs
|
||||
- sudo mvn jetty:run &
|
||||
- cd $SW
|
||||
|
||||
# show host table to confirm petstore.swagger.io is mapped to localhost
|
||||
- cat /etc/hosts
|
||||
@@ -34,4 +64,4 @@ before_install:
|
||||
|
||||
script:
|
||||
# run integration tests defined in maven pom.xml
|
||||
- mvn -q --batch-mode verify -Psamples.ios -Dmaven.javadoc.skip=true
|
||||
- mvn -q --batch-mode verify -Psamples
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
---
|
||||
format_version: '8'
|
||||
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
|
||||
project_type: other
|
||||
trigger_map:
|
||||
- push_branch: "*"
|
||||
workflow: primary
|
||||
- pull_request_source_branch: "*"
|
||||
workflow: primary
|
||||
workflows:
|
||||
primary:
|
||||
steps:
|
||||
- git-clone@4.0.17: {}
|
||||
- brew-install@0.10.2:
|
||||
inputs:
|
||||
- packages: maven
|
||||
- script@1.1.5:
|
||||
title: Install Cocoapods
|
||||
inputs:
|
||||
- content: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sudo gem install cocoapods
|
||||
- script@1.1.5:
|
||||
inputs:
|
||||
- content: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
mvn package
|
||||
title: Build openapi-generator
|
||||
- script@1.1.5:
|
||||
title: Update Swift4 samples
|
||||
inputs:
|
||||
- content: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
sh bin/swift4-all.sh
|
||||
- script@1.1.5:
|
||||
inputs:
|
||||
- content: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
./samples/client/petstore/swift4/swift4_test_all.sh && ./samples/client/test/swift4/swift4_test_all.sh && exit ${PIPESTATUS[0]}
|
||||
title: Run Swift4 tests
|
||||
|
||||
@@ -128,6 +128,8 @@ public class PetApiTest {
|
||||
//empty
|
||||
}
|
||||
});
|
||||
// the API call should be executed asynchronously, so result should be empty at the moment
|
||||
assertTrue(result.isEmpty());
|
||||
|
||||
// wait for the asynchronous call to finish (at most 10 seconds)
|
||||
final int maxTry = 10;
|
||||
@@ -144,14 +146,6 @@ public class PetApiTest {
|
||||
}
|
||||
} while (result.isEmpty());
|
||||
assertPetMatches(pet, fetched);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateAndGetPetAsyncInvalidID() throws Exception {
|
||||
Pet pet = createPet();
|
||||
api.addPet(pet);
|
||||
// to store returned Pet or error message/exception
|
||||
final Map<String, Object> result = new HashMap<String, Object>();
|
||||
|
||||
// test getting a nonexistent pet
|
||||
result.clear();
|
||||
@@ -178,11 +172,8 @@ public class PetApiTest {
|
||||
});
|
||||
|
||||
// wait for the asynchronous call to finish (at most 10 seconds)
|
||||
final int maxTry = 10;
|
||||
int tryCount = 1;
|
||||
Pet fetched = null;
|
||||
tryCount = 1;
|
||||
ApiException exception = null;
|
||||
|
||||
do {
|
||||
if (tryCount > maxTry) fail("have not got result of getPetByIdAsync after 10 seconds");
|
||||
Thread.sleep(1000);
|
||||
@@ -423,16 +414,16 @@ public class PetApiTest {
|
||||
assertEquals(expected.getId(), actual.getId());
|
||||
assertNotNull(actual.getCategory());
|
||||
assertEquals(expected.getCategory().getName(),
|
||||
actual.getCategory().getName());
|
||||
actual.getCategory().getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that the given upload/download progress list satisfies the
|
||||
* following constraints:
|
||||
* <p>
|
||||
* - List is not empty
|
||||
* - Byte count should be nondecreasing
|
||||
* - The last element, and only the last element, should have done=true
|
||||
*
|
||||
* - List is not empty
|
||||
* - Byte count should be nondecreasing
|
||||
* - The last element, and only the last element, should have done=true
|
||||
*/
|
||||
private void assertValidProgress(List<Progress> progressList) {
|
||||
assertFalse(progressList.isEmpty());
|
||||
@@ -443,7 +434,7 @@ public class PetApiTest {
|
||||
if (prev != null) {
|
||||
if (prev.done || prev.bytes > progress.bytes) {
|
||||
fail("Progress list out of order at index " + index
|
||||
+ ": " + progressList);
|
||||
+ ": " + progressList);
|
||||
}
|
||||
}
|
||||
prev = progress;
|
||||
@@ -459,9 +450,9 @@ public class PetApiTest {
|
||||
|
||||
private final CountDownLatch latch;
|
||||
private final ConcurrentLinkedQueue<Progress> uploadProgress =
|
||||
new ConcurrentLinkedQueue<Progress>();
|
||||
new ConcurrentLinkedQueue<Progress>();
|
||||
private final ConcurrentLinkedQueue<Progress> downloadProgress =
|
||||
new ConcurrentLinkedQueue<Progress>();
|
||||
new ConcurrentLinkedQueue<Progress>();
|
||||
|
||||
private boolean done;
|
||||
private boolean success;
|
||||
|
||||
@@ -27,7 +27,6 @@ RUN mvn -am -pl "modules/openapi-generator-cli" package
|
||||
|
||||
# This exists at the end of the file to benefit from cached layers when modifying docker-entrypoint.sh.
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
RUN ln -s /usr/local/bin/docker-entrypoint.sh /usr/local/bin/openapi-generator
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
|
||||
58
README.md
58
README.md
@@ -2,26 +2,17 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.2`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`4.2.0-SNAPSHOT`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||
[](https://cloud.drone.io/OpenAPITools/openapi-generator)
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
|
||||
[`4.3.x`](https://github.com/OpenAPITools/openapi-generator/tree/4.3.x) branch: [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||
[](https://cloud.drone.io/OpenAPITools/openapi-generator)
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
|
||||
[`5.0.x`](https://github.com/OpenAPITools/openapi-generator/tree/5.0.x) branch: [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||
[](https://cloud.drone.io/OpenAPITools/openapi-generator)
|
||||
[](https://app.bitrise.io/app/4a2b10a819d12b67)
|
||||
</div>
|
||||
|
||||
<div align="center">
|
||||
@@ -111,9 +102,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
OpenAPI Generator Version | Release Date | Notes
|
||||
---------------------------- | ------------ | -----
|
||||
5.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.0-SNAPSHOT/)| 13.05.2020 | Major release with breaking changes (no fallback)
|
||||
4.3.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.3.0-SNAPSHOT/)| 29.02.2020 | Minor release (breaking changes with fallbacks)
|
||||
4.2.2 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.2/)| 02.12.2019 | Patch release
|
||||
[4.2.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.2.1) (latest stable release) | 15.11.2019 | Patch release
|
||||
4.2.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.2.0-SNAPSHOT/)| 09.10.2019 | Minor release (breaking changes with fallbacks)
|
||||
[4.1.3](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.1.3) (latest stable release) | 04.10.2019 | Patch release (bug fixes, enhancements)
|
||||
|
||||
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
|
||||
|
||||
@@ -169,16 +159,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
|
||||
<!-- RELEASE_VERSION -->
|
||||
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
|
||||
|
||||
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.1/openapi-generator-cli-4.2.1.jar`
|
||||
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.3/openapi-generator-cli-4.1.3.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.1/openapi-generator-cli-4.2.1.jar -O openapi-generator-cli.jar
|
||||
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.3/openapi-generator-cli-4.1.3.jar -O openapi-generator-cli.jar
|
||||
```
|
||||
|
||||
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
||||
```
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.1/openapi-generator-cli-4.2.1.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.3/openapi-generator-cli-4.1.3.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -393,10 +383,10 @@ openapi-generator version
|
||||
```
|
||||
|
||||
<!-- RELEASE_VERSION -->
|
||||
Or install a particular OpenAPI Generator version (e.g. v4.1.2):
|
||||
Or install a particular OpenAPI Generator version (e.g. v4.1.3):
|
||||
|
||||
```sh
|
||||
npm install @openapitools/openapi-generator-cli@cli-4.1.2 -g
|
||||
npm install @openapitools/openapi-generator-cli@cli-4.1.3 -g
|
||||
```
|
||||
|
||||
Or install it as dev-dependency:
|
||||
@@ -420,7 +410,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat
|
||||
(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
||||
|
||||
<!-- RELEASE_VERSION -->
|
||||
You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.1/openapi-generator-cli-4.2.1.jar)
|
||||
You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/4.1.3/openapi-generator-cli-4.1.3.jar)
|
||||
<!-- /RELEASE_VERSION -->
|
||||
|
||||
To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate`
|
||||
@@ -525,7 +515,7 @@ Please refer to [customization.md](docs/customization.md) on how to customize th
|
||||
|
||||
### [3.2 - Workflow Integration (Maven, Gradle, Github, CI/CD)](#table-of-contents)
|
||||
|
||||
Please refer to [integration.md](docs/integration.md) on how to integrate OpenAPI generator with Maven, Gradle, sbt, Bazel, Github and CI/CD.
|
||||
Please refer to [integration.md](docs/integration.md) on how to integrate OpenAPI generator with Maven, Gradle, Github and CI/CD.
|
||||
|
||||
### [3.3 - Online OpenAPI generator](#table-of-contents)
|
||||
|
||||
@@ -580,7 +570,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [Camptocamp](https://www.camptocamp.com/en)
|
||||
- [codecentric AG](https://www.codecentric.de/)
|
||||
- [Commencis](https://www.commencis.com/)
|
||||
- [Crossover Health](https://crossoverhealth.com/)
|
||||
- [Cupix](https://www.cupix.com/)
|
||||
- [DB Systel](https://www.dbsystel.de)
|
||||
- [dwango](https://dwango.co.jp/)
|
||||
@@ -588,18 +577,15 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [Element AI](https://www.elementai.com/)
|
||||
- [Fenergo](https://www.fenergo.com/)
|
||||
- [FormAPI](https://formapi.io/)
|
||||
- [FreshCells](https://www.freshcells.de/)
|
||||
- [Fuse](https://www.fuse.no/)
|
||||
- [Gantner](https://www.gantner.com)
|
||||
- [GenFlow](https://github.com/RepreZen/GenFlow)
|
||||
- [GetYourGuide](https://www.getyourguide.com/)
|
||||
- [GMO Pepabo](https://pepabo.com/en/)
|
||||
- [GoDaddy](https://godaddy.com)
|
||||
- [Here](https://developer.here.com/)
|
||||
- [IBM](https://www.ibm.com/)
|
||||
- [JustStar](https://www.juststarinfo.com)
|
||||
- [Klarna](https://www.klarna.com/)
|
||||
- [Kronsoft Development](https://www.kronsoft.ro/home/)
|
||||
- [Médiavision](https://www.mediavision.fr/)
|
||||
- [Metaswitch](https://www.metaswitch.com/)
|
||||
- [Myworkout](https://myworkout.com)
|
||||
@@ -609,13 +595,10 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [Ponicode](https://ponicode.dev/)
|
||||
- [Pricefx](https://www.pricefx.com/)
|
||||
- [Prometheus/Alertmanager](https://github.com/prometheus/alertmanager)
|
||||
- [QEDIT](https://qed-it.com)
|
||||
- [Qulix Systems](https://www.qulix.com)
|
||||
- [Raiffeisen Schweiz Genossenschaft](https://www.raiffeisen.ch)
|
||||
- [RedHat](https://www.redhat.com)
|
||||
- [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development)
|
||||
- [REST United](https://restunited.com)
|
||||
- [Sony Interactive Entertainment](https://www.sie.com/en/index.html)
|
||||
- [Stingray](http://www.stingray.com)
|
||||
- [Suva](https://www.suva.ch/)
|
||||
- [Telstra](https://dev.telstra.com)
|
||||
@@ -626,7 +609,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [WSO2](https://wso2.com/)
|
||||
- [Vouchery.io](https://vouchery.io)
|
||||
- [Xero](https://www.xero.com/)
|
||||
- [Yahoo Japan](https://www.yahoo.co.jp/)
|
||||
- [Yelp](https://www.yelp.com/)
|
||||
- [Zalando](https://www.zalando.com)
|
||||
|
||||
@@ -695,17 +677,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- 2019-10-16 - [How to ship APIs faster?](https://medium.com/@accounts_76224/how-to-ship-apis-faster-cabef2f819e4) by [Simon Guilliams @ PoniCode](https://ponicode.dev)
|
||||
- 2019-10-22 - [OpenAPI + Spring Boot(Kotlin)でファイルダウンロードAPIを作成する](https://qiita.com/boronngo/items/4b78b92526209daeaee9) by [Yuki Furukawa](https://twitter.com/yuki_furukawa5)
|
||||
- 2019-10-24 - [Microprofile OpenAPI - Code First or Design First?](https://github.com/pe-st/apidocs/blob/master/MicroProfile-OpenAPI-all-slides.pdf) by [Peter [pɛʃə] Steiner](https://twitter.com/pesche) at [eclipsecon Europe 2019](https://www.eclipsecon.org/europe2019/sessions/microprofile-openapi-code-first-or-design-first)
|
||||
- 2019-11-06 - [Generating API clients based on OpenAPI v3 specifications](https://98elements.com/blog/generating-api-clients-based-on-openapi-v3-specifications) by [Dominik Jastrzębski @ 98elements](https://98elements.com)
|
||||
- 2019-11-06 - [OpenAPIを利用して自前のAPIサーバー(Sinatra)を移植した時のメモ](https://qiita.com/YasuhiroABE/items/c73920eab2d9d6e97fd9) by [Yasuhiro ABE](https://twitter.com/YasuhiroABE)
|
||||
- 2019-11-07 - [API First development with OpenAPI - You should you practise it !?](https://www.youtube.com/watch?v=F9iF3a1Z8Y8) by [Nick Van Hoof](https://www.nickvanhoof.com/) at [Devoxx Belgium 2019](https://devoxx.be/)
|
||||
- 2019-11-08 - [JHipster beyond CRUD - API-First for Enterprises by Enrico Costanzi](https://www.youtube.com/watch?v=m28JFovKQ20) by [Enrico Costanzi](https://twitter.com/enricocostanzi) at [JHipster Conf 2019 in Paris](https://jhipster-conf.github.io/)
|
||||
- 2019-11-11 - [TypeScript REST APIクライアント](https://qiita.com/unhurried/items/7b74f7d3c43545dadd2b) by [@unhurried](https://qiita.com/unhurried)
|
||||
- 2019-11-11 - [One Spec to Rule them all - OpenAPI in Action](https://www.youtube.com/watch?v=MMay_nht8ec) by [Andreas Litt](https://github.com/littldr) at [code.talks 2019](https://www.codetalks.com/)
|
||||
- 2019-11-17 - [OpenAPI Generator YouTube playlist](https://www.youtube.com/playlist?list=PLtJyHVMdzfF6fBkOUV5VDVErP23CGgHIy) at [YouTube](https://www.youtube.com)
|
||||
- 2019-11-20 - [Introduction to OpenAPI](https://noti.st/lornajane/HvDH7U/introduction-to-openapi) by [Lorna Mitchell](https://twitter.com/lornajane) at [GOTO Copenhagen 2019](https://gotocph.com/2019/)
|
||||
- 2019/11/23 - [Swagger ではない OpenAPI Specification 3.0 による API サーバー開発](https://www.slideshare.net/techblogyahoo/swagger-openapi-specification-30-api) by [Tetsuya Morimoto](https://github.com/t2y) at [JJUG CCC 2019 Fall](https://ccc2019fall.java-users.jp/)
|
||||
- 2019-11-25 - [openapi-generatorで手軽にスタブサーバとクライアントの生成](https://qiita.com/pochopocho13/items/8db662e1934fb2b408b8) by [@pochopocho13](https://twitter.com/pochopocho13)
|
||||
- 2019-11-26 - [CordaCon 2019 Highlights: Braid Server and OpenAPI Generator for Corda Client API’s](https://blog.b9lab.com/cordacon-2019-highlights-braid-server-and-openapi-generator-for-corda-flows-api-s-d24179ccb27c) by [Adel Rustum](https://blog.b9lab.com/@adelrestom) at [B9lab](https://blog.b9lab.com/)
|
||||
|
||||
## [6 - About Us](#table-of-contents)
|
||||
|
||||
@@ -795,7 +766,6 @@ Here is a list of template creators:
|
||||
* TypeScript (Node): @mhardorf
|
||||
* TypeScript (Rxjs): @denyo
|
||||
* TypeScript (Inversify): @gualtierim
|
||||
* TypeSCript (redux-query): @petejohansonxo
|
||||
* Server Stubs
|
||||
* Ada: @stcarrez
|
||||
* C# ASP.NET 5: @jimschubert [:heart:](https://www.patreon.com/jimschubert)
|
||||
@@ -900,7 +870,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| Groovy | |
|
||||
| Haskell | |
|
||||
| Java | @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10) |
|
||||
| Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) @4brunu (2019/11) |
|
||||
| Kotlin | @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @dr4ke616 (2018/08) @karismann (2019/03) @Zomzog (2019/04) @andrewemery (2019/10) |
|
||||
| Lua | @daurnimator (2017/08) |
|
||||
| Nim | |
|
||||
| NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) |
|
||||
@@ -909,13 +879,13 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| 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 | |
|
||||
| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @slash-arun (2019/11) @spacether (2019/11)|
|
||||
| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) |
|
||||
| R | @Ramanth (2019/07) @saigiridhar21 (2019/07) |
|
||||
| Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
|
||||
| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) @richardwhiuk (2019/07) |
|
||||
| Scala | @clasnake (2017/07), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @shijinkui (2018/01), @ramzimaalej (2018/03) |
|
||||
| Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @d-date (2018/03) @4brunu (2019/11) |
|
||||
| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) |
|
||||
| Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @d-date (2018/03) |
|
||||
| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @nicokoenig (2018/09) @topce (2018/10) @akehir (2019/07) |
|
||||
|
||||
:heart: = Link to support the contributor directly
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"generatorName": "php-slim4",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/3_0/petstore.yaml",
|
||||
"outputDir": "samples/server/petstore/php-slim4",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/php-slim4-server"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"generatorName": "php-symfony",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml",
|
||||
"outputDir": "samples/server/petstore/php-symfony/SymfonyBundle-php",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/php-symfony"
|
||||
"inputSpec": "/Users/jim/projects/openapi-generator/bin/../modules/openapi-generator/src/test/resources/2_0/petstore.yaml",
|
||||
"outputDir": "/Users/jim/projects/openapi-generator/bin/../samples/server/petstore/php-symfony/SymfonyBundle-php",
|
||||
"templateDir": "/Users/jim/projects/openapi-generator/bin/../modules/openapi-generator/src/main/resources/php-symfony"
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"generatorName": "python-experimental",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/python-experimental",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/python",
|
||||
"additionalProperties": {
|
||||
"packageName": "petstore_api"
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
"outputDir": "samples/server/petstore/springboot",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/JavaSpring",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true,
|
||||
"snapshotVersion": true
|
||||
"hideGenerationTimestamp": true
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml",
|
||||
"outputDir": "samples/client/petstore/cpp-qt5",
|
||||
"additionalProperties": {
|
||||
"cppNamespace": "test_namespace",
|
||||
"modelNamePrefix": "PFX"
|
||||
}
|
||||
}
|
||||
@@ -27,10 +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"
|
||||
args="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client \
|
||||
-i modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
|
||||
-g cpp-qt5-client \
|
||||
-c bin/cpp-qt5-petstore.json \
|
||||
$@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-qt5-client -o samples/client/petstore/cpp-qt5 $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $args
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
./bin/kotlin-client-gson.sh
|
||||
./bin/kotlin-client-nonpublic.sh
|
||||
./bin/kotlin-client-okhttp3.sh
|
||||
./bin/kotlin-client-petstore-multiplatform.sh
|
||||
./bin/kotlin-client-petstore.sh
|
||||
./bin/kotlin-client-string.sh
|
||||
./bin/kotlin-client-threetenbp.sh
|
||||
./bin/kotlin-client-nullable.sh
|
||||
|
||||
@@ -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/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-gson --additional-properties serializationLibrary=gson -o samples/client/petstore/kotlin-gson $@"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
||||
@@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-nonpublic --additional-properties nonPublicApi=true -o samples/client/petstore/kotlin-nonpublic $@"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
||||
|
||||
cp CI/samples.ci/client/petstore/kotlin-string/pom.xml samples/client/petstore/kotlin-string/pom.xml
|
||||
|
||||
@@ -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/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-nullable --additional-properties nullableReturnType=true,serializableModel=true -o samples/client/petstore/kotlin-nullable $@"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
||||
@@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-okhttp3 --library jvm-okhttp3 -o samples/client/petstore/kotlin-okhttp3 $@"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
||||
|
||||
#cp CI/samples.ci/client/petstore/kotlin-okhttp3/pom.xml samples/client/petstore/kotlin-okhttp3/pom.xml
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
./bin/kotlin-springboot-petstore-server.sh
|
||||
./bin/kotlin-springboot-petstore-server-reactive.sh
|
||||
./bin/kotlin-springboot-petstore-server-model-mutable.sh
|
||||
./bin/kotlin-springboot-petstore-server-reactive.sh
|
||||
@@ -1,35 +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
|
||||
|
||||
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-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot-modelMutable --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true,modelMutable=true"
|
||||
|
||||
echo "Cleaning previously generated files if any from samples/server/petstore/kotlin-springboot"
|
||||
rm -rf samples/server/petstore/kotlin-springboot-modelMutable
|
||||
|
||||
echo "Generating Kotling Spring Boot server..."
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -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/2_0/petstore.yaml -g kotlin-vertx -o samples/server/petstore/kotlin/vertx --additional-properties=modelMutable=false"
|
||||
ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin-vertx -o samples/server/petstore/kotlin/vertx"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
declare cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
declare root="$(cd "$cwd" && cd ../ && pwd)"
|
||||
|
||||
if ! command -v gradle > /dev/null; then
|
||||
echo "[WARN] This script requires a system gradle to be installed. Not treating this as an error."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
executable="${root}/modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
(cd "$root" && ./mvnw -B clean package)
|
||||
fi
|
||||
|
||||
\rm -rf "${root}/samples/meta-codegen-kotlin/lib"
|
||||
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="meta -n myClientCodegen -t DOCUMENTATION -p com.my.company.codegen -o samples/meta-codegen-kotlin/lib -l kotlin $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
if [ ! -f "${root}"samples/meta-codegen-kotlin/gradle/wrapper/gradle-wrapper.jar ]; then
|
||||
(cd "${root}"/samples/meta-codegen-kotlin/ && gradle wrapper --gradle-version 5.6.2 --distribution-type bin)
|
||||
fi
|
||||
|
||||
|
||||
(cp "${root}"/samples/meta-codegen-kotlin/gradlew "${root}"/samples/meta-codegen-kotlin/lib/ && \
|
||||
cp -R "${root}"/samples/meta-codegen-kotlin/gradle "${root}"/samples/meta-codegen-kotlin/lib/ && \
|
||||
cd "${root}"/samples/meta-codegen-kotlin/lib && \
|
||||
./gradlew shadowJar)
|
||||
|
||||
ags2="generate -g myClientCodegen -i modules/openapi-generator/src/test/resources/2_0/petstore.json -o samples/meta-codegen-kotlin/usage $@"
|
||||
|
||||
java $JAVA_OPTS -cp ${root}/samples/meta-codegen-kotlin/lib/build/libs/my-client-codegen-openapi-generator-1.0-SNAPSHOT-all.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2
|
||||
@@ -1,15 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
declare cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
declare root="$(cd "$cwd" && cd ../ && pwd)"
|
||||
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
|
||||
|
||||
executable="${root}/modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
if [ ! -f "$executable" ]; then
|
||||
(cd "$root" && ./mvnw -B clean package)
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
./mvnw -B clean package
|
||||
fi
|
||||
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
@@ -17,8 +30,8 @@ ags="meta -n myClientCodegen -t DOCUMENTATION -p com.my.company.codegen -o sampl
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
(cd "$root" && ./mvnw clean package -f samples/meta-codegen/pom.xml)
|
||||
./mvnw clean package -f samples/meta-codegen/pom.xml
|
||||
|
||||
ags2="generate -g myClientCodegen -i modules/openapi-generator/src/test/resources/2_0/petstore.json -o samples/meta-codegen/usage $@"
|
||||
|
||||
java $JAVA_OPTS -cp ${root}/samples/meta-codegen/lib/target/myClientCodegen-openapi-generator-1.0.0.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2
|
||||
java $JAVA_OPTS -cp samples/meta-codegen/lib/target/myClientCodegen-openapi-generator-1.0.0.jar:$executable org.openapitools.codegen.OpenAPIGenerator $ags2
|
||||
|
||||
@@ -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"
|
||||
args="generate -t modules/openapi-generator/src/main/resources/bash -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g bash -o samples/client/petstore/bash -c modules/openapi-generator/src/test/resources/2_0/bash-config.json --additional-properties hideGenerationTimestamp=true $@"
|
||||
args="generate -t modules/openapi-generator/src/main/resources/bash -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g bash -o samples/client/petstore/bash -c modules/openapi-generator/src/test/resources/3_0/bash-config.json --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $args
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
./bin/openapi3/elm-petstore.sh
|
||||
./bin/openapi3/elm-composition.sh
|
||||
|
||||
@@ -1,35 +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
|
||||
|
||||
# auto format elm code using elm-format
|
||||
export ELM_POST_PROCESS_FILE="/usr/bin/env elm-format --elm-version=0.19 --yes"
|
||||
|
||||
# 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/composition.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/openapi3/client/composition/elm --enable-post-process-file $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -3,5 +3,4 @@
|
||||
|
||||
./bin/python-asyncio-petstore.sh
|
||||
./bin/python-petstore.sh
|
||||
./bin/python-experimental-petstore.sh
|
||||
./bin/python-tornado-petstore.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 --artifact-id springboot -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot --additional-properties hideGenerationTimestamp=true,snapshotVersion=true $@"
|
||||
ags="generate --artifact-id springboot -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
echo "Removing files and folders under samples/server/petstore/springboot/src/main"
|
||||
rm -rf samples/server/petstore/springboot/src/main
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
./bin/swift4-petstore.sh
|
||||
./bin/swift4-petstore-promisekit.sh
|
||||
./bin/swift4-petstore-result.sh
|
||||
./bin/swift4-petstore-rxswift.sh
|
||||
./bin/swift4-petstore-objcCompatible.sh
|
||||
./bin/swift4-petstore-unwrapRequired.sh
|
||||
./bin/swift4-petstore-nonPublicApi.sh
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"podSummary": "PetstoreClient",
|
||||
"podHomepage": "https://github.com/openapitools/openapi-generator",
|
||||
"podAuthors": "",
|
||||
"projectName": "PetstoreClient",
|
||||
"nonPublicApi": true
|
||||
}
|
||||
@@ -1,42 +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/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-nonPublicApi.json -o samples/client/petstore/swift4/nonPublicApi --generate-alias-as-model $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
if type "xcodegen" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/nonPublicApi
|
||||
xcodegen generate
|
||||
fi
|
||||
|
||||
if type "swiftlint" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/nonPublicApi
|
||||
swiftlint autocorrect
|
||||
fi
|
||||
@@ -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/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-objcCompatible.json -o samples/client/petstore/swift4/objcCompatible --generate-alias-as-model $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-objcCompatible.json -o samples/client/petstore/swift4/objcCompatible $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
|
||||
@@ -27,16 +27,16 @@ 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/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-promisekit.json -o samples/client/petstore/swift4/promisekitLibrary --generate-alias-as-model $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-promisekit.json -o samples/client/petstore/swift4/promisekit --generate-alias-as-model $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
if type "xcodegen" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/promisekitLibrary
|
||||
cd samples/client/petstore/swift4/promisekit
|
||||
xcodegen generate
|
||||
fi
|
||||
|
||||
if type "swiftlint" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/promisekitLibrary
|
||||
cd samples/client/petstore/swift4/promisekit
|
||||
swiftlint autocorrect
|
||||
fi
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"podSummary": "PetstoreClient",
|
||||
"podHomepage": "https://github.com/openapitools/openapi-generator",
|
||||
"podAuthors": "",
|
||||
"projectName": "PetstoreClient",
|
||||
"responseAs": "Result"
|
||||
}
|
||||
@@ -1,42 +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/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-result.json -o samples/client/petstore/swift4/resultLibrary --generate-alias-as-model $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
if type "xcodegen" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/resultLibrary
|
||||
xcodegen generate
|
||||
fi
|
||||
|
||||
if type "swiftlint" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/resultLibrary
|
||||
swiftlint autocorrect
|
||||
fi
|
||||
@@ -27,16 +27,16 @@ 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/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-rxswift.json -o samples/client/petstore/swift4/rxswiftLibrary --generate-alias-as-model $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml -g swift4 -c ./bin/swift4-petstore-rxswift.json -o samples/client/petstore/swift4/rxswift --generate-alias-as-model $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
if type "xcodegen" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/rxswiftLibrary
|
||||
cd samples/client/petstore/swift4/rxswift
|
||||
xcodegen generate
|
||||
fi
|
||||
|
||||
if type "swiftlint" > /dev/null 2>&1; then
|
||||
cd samples/client/petstore/swift4/rxswiftLibrary
|
||||
cd samples/client/petstore/swift4/rxswift
|
||||
swiftlint autocorrect
|
||||
fi
|
||||
@@ -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/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift4Test.json -g swift4 -c ./bin/swift4-test.json -o samples/client/test/swift4/default --generate-alias-as-model $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/swift4 -i modules/openapi-generator/src/test/resources/2_0/swift4Test.json -g swift4 -c ./bin/swift4-test.json -o samples/client/test/swift4/default $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
|
||||
@@ -15,4 +15,3 @@
|
||||
./bin/typescript-angular-v7-petstore-provided-in-root-with-npm.sh
|
||||
./bin/typescript-angular-v8-petstore-provided-in-root-with-npm.sh
|
||||
./bin/typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.sh
|
||||
./bin/typescript-angular-v8-petstore-single-request-parameter.sh
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"npmName": "@openapitools/typescript-redux-query-petstore",
|
||||
"npmVersion": "1.0.0",
|
||||
"npmRepository" : "https://skimdb.npmjs.com/registry",
|
||||
"snapshot" : false
|
||||
}
|
||||
@@ -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/typescript-redux-query -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-redux-query -c bin/typescript-redux-query-petstore-with-npm-version.json -o samples/client/petstore/typescript-redux-query/builds/with-npm-version $@"
|
||||
|
||||
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/typescript-redux-query -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript-redux-query -o samples/client/petstore/typescript-redux-query/builds/default $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -26,7 +26,12 @@ then
|
||||
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 -c bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json -o samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter --additional-properties ngVersion=8.0.0,useSingleRequestParameter=true $@"
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
echo "Creating default (fetch) client!"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript -o samples/client/petstore/typescript/builds/default --additional-properties=platform=node,npmName=ts-petstore-client $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
echo "Creating jquery client!"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g typescript -o samples/client/petstore/typescript/builds/jquery --additional-properties=framework=jquery,npmName=ts-petstore-client $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
## What is the purpose?
|
||||
|
||||
Running `./save_dart_keywords.sh` from this directory will generate `dart-keywords.txt` which contains the current Dart keywords and is used by the dart generator as a set of reserved words.
|
||||
|
||||
## When should the keywords be generated?
|
||||
|
||||
`save_dart_keywords.sh` should be run when a new version of Dart is release to update the keywords file.
|
||||
|
||||
The last Dart version that was used to generate the keywords can be found in `dart-version.txt`.
|
||||
|
||||
## What does the shellscript do?
|
||||
|
||||
1. compile a dart app
|
||||
- `dart2native save-dart-keywords.dart`
|
||||
|
||||
1. run the dart app
|
||||
- `./save-dart-keywords.exe`
|
||||
|
||||
1. the ouput is `dart-keywords.txt` and `dart-version.txt`
|
||||
@@ -1 +0,0 @@
|
||||
Dart VM version: 2.7.0-dev.0.0 (Tue Nov 5 12:57:33 2019 +0100) on "macos_x64"
|
||||
@@ -1,194 +0,0 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
_fe_analyzer_shared:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
analyzer:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.39.1"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.2"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.4.0"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.14.12"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: convert
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
csslib:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: csslib
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.16.1"
|
||||
front_end:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: front_end
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.29"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: glob
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
html:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: html
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.14.0+3"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: js
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.6.1+1"
|
||||
kernel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: kernel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.3.29"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.8"
|
||||
node_interop:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: node_interop
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.3"
|
||||
node_io:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: node_io
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1+2"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_config
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.6.4"
|
||||
pedantic:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0+1"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pub_semver
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.4.2"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.5"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.5"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.6"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: watcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.9.7+12"
|
||||
yaml:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
sdks:
|
||||
dart: ">=2.6.0 <3.0.0"
|
||||
@@ -1,10 +0,0 @@
|
||||
name: dart_keywords
|
||||
description: Use the Dart SDK to generate Dart keywords.
|
||||
|
||||
version: 1.0.0+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.6.0 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
analyzer:
|
||||
@@ -1,16 +0,0 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:analyzer/dart/ast/token.dart';
|
||||
|
||||
main() {
|
||||
// save keywords to a text file
|
||||
final txtFile = File(
|
||||
'../../../modules/openapi-generator/src/main/resources/dart/dart-keywords.txt');
|
||||
String txtString = '';
|
||||
for (String keyword in Keyword.keywords.keys.toList()) {
|
||||
txtString += keyword + '\n';
|
||||
}
|
||||
txtString =
|
||||
txtString.substring(0, txtString.length - 1); // remove last newline
|
||||
txtFile.writeAsStringSync(txtString);
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
dart2native save-dart-keywords.dart
|
||||
./save-dart-keywords.exe
|
||||
dart --version &> dart-version.txt
|
||||
@@ -1,122 +1,93 @@
|
||||
#!/usr/bin/env bash
|
||||
# this bash script runs the scripts for the 'mature' generators by default.
|
||||
# Supports --batch option which will compile all generators defined under bin/ci/*.json
|
||||
#!/bin/bash
|
||||
# this bash script run the scripts for the 'mature' generators
|
||||
# it ensures that all changes are committed into the 'samples/' folder
|
||||
# shellcheck disable=SC2155
|
||||
declare cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
declare root="$(cd "$cwd" && cd ../../ && pwd)"
|
||||
declare executable="${root}/modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
declare batch_mode="false"
|
||||
|
||||
echo "# START SCRIPT: $0"
|
||||
|
||||
echo "IMPORTANT: this script should be run by the CI (e.g. Shippable) to ensure that the 'samples/' folder is up to date."
|
||||
if [ "--batch" = "$1" ]; then
|
||||
batch_mode="true"
|
||||
echo "Running in 'batch mode' (single JVM, mutliple threads)."
|
||||
else
|
||||
echo "When running locally execute with argument --batch."
|
||||
fi
|
||||
echo "Please press CTRL+C to stop or the script will continue in 5 seconds."
|
||||
|
||||
sleep 5
|
||||
|
||||
declare -a samples=(
|
||||
"${root}/bin/ruby-client-petstore.sh"
|
||||
"${root}/bin/ruby-client-petstore-faraday.sh"
|
||||
"${root}/bin/openapi3/ruby-client-petstore.sh"
|
||||
"${root}/bin/openapi3/ruby-client-faraday-petstore.sh"
|
||||
"${root}/bin/java-petstore-all.sh"
|
||||
"${root}/bin/java-jaxrs-petstore-server-all.sh"
|
||||
"${root}/bin/java-msf4j-petstore-server.sh"
|
||||
"${root}/bin/openapi3/jaxrs-jersey-petstore.sh"
|
||||
"${root}/bin/spring-all-petstore.sh"
|
||||
"${root}/bin/javascript-petstore-all.sh"
|
||||
"${root}/bin/kotlin-client-all.sh"
|
||||
"${root}/bin/kotlin-server-petstore.sh"
|
||||
"${root}/bin/kotlin-springboot-petstore-server.sh"
|
||||
"${root}/bin/kotlin-springboot-petstore-server-reactive.sh"
|
||||
"${root}/bin/mysql-schema-petstore.sh"
|
||||
"${root}/bin/nim-client-petstore.sh"
|
||||
"${root}/bin/python-petstore-all.sh"
|
||||
"${root}/bin/openapi3/python-petstore.sh"
|
||||
"${root}/bin/php-petstore.sh"
|
||||
"${root}/bin/php-silex-petstore-server.sh"
|
||||
"${root}/bin/php-symfony-petstore.sh"
|
||||
"${root}/bin/php-lumen-petstore-server.sh"
|
||||
"${root}/bin/php-slim-server-petstore.sh"
|
||||
"${root}/bin/php-slim4-server-petstore.sh"
|
||||
"${root}/bin/php-ze-ph-petstore-server.sh"
|
||||
"${root}/bin/openapi3/php-petstore.sh"
|
||||
"${root}/bin/typescript-angularjs-petstore.sh"
|
||||
"${root}/bin/typescript-angular-petstore-all.sh"
|
||||
"${root}/bin/typescript-aurelia-petstore.sh"
|
||||
"${root}/bin/typescript-axios-petstore-all.sh"
|
||||
"${root}/bin/typescript-fetch-petstore-all.sh"
|
||||
"${root}/bin/typescript-inversify-petstore.sh"
|
||||
"${root}/bin/typescript-jquery-petstore-all.sh"
|
||||
"${root}/bin/typescript-node-petstore-all.sh"
|
||||
"${root}/bin/typescript-rxjs-petstore-all.sh"
|
||||
"${root}/bin/rust-server-petstore.sh"
|
||||
"${root}/bin/r-petstore.sh"
|
||||
"${root}/bin/haskell-http-client-petstore.sh"
|
||||
"${root}/bin/csharp-petstore.sh"
|
||||
"${root}/bin/csharp-netcore-petstore-all.sh"
|
||||
"${root}/bin/elixir-petstore.sh"
|
||||
"${root}/bin/openapi3/go-petstore.sh"
|
||||
"${root}/bin/go-experimental-petstore.sh"
|
||||
"${root}/bin/go-petstore.sh"
|
||||
"${root}/bin/go-petstore-withxml.sh"
|
||||
"${root}/bin/go-petstore-server.sh"
|
||||
"${root}/bin/go-gin-petstore-server.sh"
|
||||
"${root}/bin/groovy-petstore.sh"
|
||||
"${root}/bin/apex-petstore.sh"
|
||||
"${root}/bin/perl-petstore-all.sh"
|
||||
"${root}/bin/dart-jaguar-petstore.sh"
|
||||
#"${root}/bin/dart-dio-petstore.sh"
|
||||
"${root}/bin/dart-petstore.sh"
|
||||
"${root}/bin/dart2-petstore.sh"
|
||||
"${root}/bin/java-play-framework-petstore-server-all.sh"
|
||||
#"${root}/bin/elm-petstore-all.sh"
|
||||
"${root}/bin/typescript-redux-query-petstore-with-npm-version.sh"
|
||||
)
|
||||
# LIST OF SCRIPTS:
|
||||
declare -a scripts=(
|
||||
# SAMPLES
|
||||
"./bin/ruby-client-petstore.sh"
|
||||
"./bin/ruby-client-petstore-faraday.sh"
|
||||
"./bin/openapi3/ruby-client-petstore.sh"
|
||||
"./bin/openapi3/ruby-client-faraday-petstore.sh"
|
||||
|
||||
# Some special case generators may expect to be run as a stanalone process (e.g. modifying classpath)
|
||||
# Docs should always be run, regardless of batch or operation.
|
||||
declare -a always_iterate=(
|
||||
"${root}/bin/meta-codegen.sh"
|
||||
"${root}/bin/utils/export_docs_generators.sh"
|
||||
"${root}/bin/utils/copy-to-website.sh"
|
||||
"${root}/bin/utils/export_generators_readme.sh"
|
||||
)
|
||||
"./bin/java-petstore-all.sh"
|
||||
"./bin/java-jaxrs-petstore-server-all.sh"
|
||||
"./bin/java-msf4j-petstore-server.sh"
|
||||
"./bin/openapi3/jaxrs-jersey-petstore.sh"
|
||||
"./bin/spring-all-petstore.sh"
|
||||
"./bin/javascript-petstore-all.sh"
|
||||
"./bin/kotlin-client-petstore-multiplatform.sh"
|
||||
"./bin/kotlin-client-petstore.sh"
|
||||
"./bin/kotlin-client-string.sh"
|
||||
"./bin/kotlin-client-threetenbp.sh"
|
||||
"./bin/kotlin-server-petstore.sh"
|
||||
"./bin/kotlin-springboot-petstore-server.sh"
|
||||
"./bin/kotlin-springboot-petstore-server-reactive.sh"
|
||||
"./bin/mysql-schema-petstore.sh"
|
||||
"./bin/nim-client-petstore.sh"
|
||||
"./bin/python-petstore-all.sh"
|
||||
"./bin/openapi3/python-petstore.sh"
|
||||
"./bin/php-petstore.sh"
|
||||
"./bin/php-silex-petstore-server.sh"
|
||||
"./bin/php-symfony-petstore.sh"
|
||||
"./bin/php-lumen-petstore-server.sh"
|
||||
"./bin/php-slim-server-petstore.sh"
|
||||
"./bin/php-slim4-server-petstore.sh"
|
||||
"./bin/php-ze-ph-petstore-server.sh"
|
||||
"./bin/openapi3/php-petstore.sh"
|
||||
"./bin/typescript-angularjs-petstore.sh"
|
||||
"./bin/typescript-angular-petstore-all.sh"
|
||||
"./bin/typescript-aurelia-petstore.sh"
|
||||
"./bin/typescript-axios-petstore-all.sh"
|
||||
"./bin/typescript-fetch-petstore-all.sh"
|
||||
"./bin/typescript-inversify-petstore.sh"
|
||||
"./bin/typescript-jquery-petstore-all.sh"
|
||||
"./bin/typescript-node-petstore-all.sh"
|
||||
"./bin/typescript-rxjs-petstore-all.sh"
|
||||
"./bin/rust-server-petstore.sh"
|
||||
"./bin/r-petstore.sh"
|
||||
"./bin/haskell-http-client-petstore.sh"
|
||||
"./bin/csharp-petstore.sh"
|
||||
"./bin/csharp-netcore-petstore-all.sh"
|
||||
"./bin/elixir-petstore.sh"
|
||||
"./bin/openapi3/go-petstore.sh"
|
||||
"./bin/go-experimental-petstore.sh"
|
||||
"./bin/go-petstore.sh"
|
||||
"./bin/go-petstore-withxml.sh"
|
||||
"./bin/go-petstore-server.sh"
|
||||
"./bin/go-gin-petstore-server.sh"
|
||||
"./bin/groovy-petstore.sh"
|
||||
"./bin/apex-petstore.sh"
|
||||
"./bin/perl-petstore-all.sh"
|
||||
"./bin/dart-jaguar-petstore.sh"
|
||||
#"./bin/dart-dio-petstore.sh"
|
||||
"./bin/dart-petstore.sh"
|
||||
"./bin/dart2-petstore.sh"
|
||||
"./bin/java-play-framework-petstore-server-all.sh"
|
||||
"./bin/elm-petstore-all.sh"
|
||||
"./bin/meta-codegen.sh"
|
||||
"./bin/typescript.sh"
|
||||
# OTHERS
|
||||
"./bin/utils/export_docs_generators.sh"
|
||||
"./bin/utils/copy-to-website.sh"
|
||||
"./bin/utils/export_generators_readme.sh")
|
||||
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Djava.awt.headless=true"
|
||||
export JAVA_OPTS="-Djava.awt.headless=true"
|
||||
|
||||
if [ "true" = "$batch_mode" ]; then
|
||||
if [ ! -f "$executable" ]; then
|
||||
(cd "${root}" && mvn -B clean package -DskipTests=true -Dmaven.javadoc.skip=true)
|
||||
for script in "${scripts[@]}"; do
|
||||
if eval $script > /dev/null 2>&1; then
|
||||
echo "Executed $script successfully!"
|
||||
else
|
||||
echo "ERROR: Failed to run $script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
java $JAVA_OPTS -jar "$executable" batch --includes-base-dir "${root}" --fail-fast -- "${root}"/bin/ci/*
|
||||
else
|
||||
for script in "${samples[@]}"; do
|
||||
if eval "$script" > /dev/null 2>&1; then
|
||||
echo "Executed $script successfully!"
|
||||
else
|
||||
echo "ERROR: Failed to run $script"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
for i in "${always_iterate[@]}"; do
|
||||
if eval "$i" > /dev/null 2>&1; then
|
||||
echo "Executed $i successfully!"
|
||||
else
|
||||
echo "ERROR: Failed to run $i"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Check:
|
||||
@@ -132,4 +103,3 @@ if [ -n "$(git status --porcelain)" ]; then
|
||||
else
|
||||
echo "Git working tree is clean"
|
||||
fi
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ set -o pipefail
|
||||
|
||||
for cmd in {mvn,jq,curl}; do
|
||||
if ! command -v ${cmd} > /dev/null; then
|
||||
>&2 echo "This script requires '${cmd}' to be installed."
|
||||
>&2 echo "This script requires '${cmd}' to be installed."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
@@ -42,18 +42,7 @@ artifactid=openapi-generator-cli
|
||||
ver=${OPENAPI_GENERATOR_VERSION:-$(latest.tag $ghrepo)}
|
||||
|
||||
jar=${artifactid}-${ver}.jar
|
||||
|
||||
# TODO: Remove OPENAPI_GENERATOR_DOWLOAD_CACHE_DIR for release 5.0
|
||||
if [ -n "${OPENAPI_GENERATOR_DOWLOAD_CACHE_DIR}" ]; then
|
||||
>&2 printf "[WARN] Variable OPENAPI_GENERATOR_DOWLOAD_CACHE_DIR is misspelled.\nPlease change to OPENAPI_GENERATOR_DOWNLOAD_CACHE_DIR. This option will be removed in the 5.0 release.\n"
|
||||
fi
|
||||
cachedir=${OPENAPI_GENERATOR_DOWNLOAD_CACHE_DIR:-"$OPENAPI_GENERATOR_DOWLOAD_CACHE_DIR"}
|
||||
|
||||
DIR=${cachedir:-"$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"}
|
||||
|
||||
if [ ! -d "${DIR}" ]; then
|
||||
mkdir -p "${DIR}"
|
||||
fi
|
||||
DIR=${OPENAPI_GENERATOR_DOWLOAD_CACHE_DIR:-"$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"}
|
||||
|
||||
if [ ! -f ${DIR}/${jar} ]; then
|
||||
repo="central::default::https://repo1.maven.org/maven2/"
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
call powershell -command "& '%~dp0\kotlin-client-gson.bat'"
|
||||
call powershell -command "& '%~dp0\kotlin-client-nonpublic.bat'"
|
||||
call powershell -command "& '%~dp0\kotlin-client-okhttp3.bat'"
|
||||
call powershell -command "& '%~dp0\kotlin-client-petstore-multiplatform.bat'"
|
||||
call powershell -command "& '%~dp0\kotlin-client-petstore.bat'"
|
||||
call powershell -command "& '%~dp0\kotlin-client-string.bat'"
|
||||
call powershell -command "& '%~dp0\kotlin-client-threetenbp.bat'"
|
||||
call powershell -command "& '%~dp0\kotlin-client-nullable.bat'"
|
||||
@@ -1,10 +0,0 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate --artifact-id "kotlin-petstore-gson" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --additional-properties serializationLibrary=gson -o samples\client\petstore\kotlin-gson
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
@@ -1,10 +0,0 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate --artifact-id "kotlin-petstore-nonpublic" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --additional-properties nonPublicApi=true -o samples\client\petstore\kotlin-nonpublic
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
@@ -1,10 +0,0 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --artifact-id "kotlin-petstore-nullable" --additional-properties nullableReturnType=true,serializableModel=true -o samples\client\petstore\kotlin-nullable
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
@@ -1,10 +0,0 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate --artifact-id "kotlin-petstore-okhttp3" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --library jvm-okhttp3 -o samples\client\petstore\kotlin-okhttp3
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate --artifact-id "kotlin-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin -o samples\client\petstore\kotlin --additional-properties dateLibrary=java8,serializableModel=true
|
||||
set ags=generate --artifact-id "kotlin-petstore-client" -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin -o samples\client\petstore\kotlin
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --artifact-id "kotlin-petstore-string" --additional-properties dateLibrary=string,serializableModel=true -o samples\client\petstore\kotlin-string
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
@@ -1,10 +0,0 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g kotlin --artifact-id "kotlin-petstore-threetenbp" --additional-properties dateLibrary=threetenbp -o samples\client\petstore\kotlin-threetenbp
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
@@ -13,4 +13,3 @@ call .\bin\windows\typescript-angular-v7-not-provided-in-root.bat
|
||||
call .\bin\windows\typescript-angular-v7-not-provided-in-root-with-npm.bat
|
||||
call .\bin\windows\typescript-angular-v8-provided-in-root-with-npm.bat
|
||||
call .\bin\windows\typescript-angular-v8-petstore-provided-in-root-with-prefixed-module-name.bat
|
||||
call .\bin\windows\typescript-angular-v8-single-request-parameter.bat
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -c bin/typescript-angular-v8-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v8-provided-in-root\builds\single-request-parameter --additional-properties ngVersion=8.0.0,useSingleRequestParameter=true
|
||||
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
@@ -1,10 +0,0 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -c bin\typescript-redux-query-petstore-with-npm-version.json -g typescript-redux-query -o samples\client\petstore\typescript-redux-query\builds\with-npm-version
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
@@ -1,14 +0,0 @@
|
||||
@ECHO OFF
|
||||
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
|
||||
echo
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-redux-query -o samples\client\petstore\typescript-redux-query\builds\default
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
@@ -57,6 +57,7 @@ The following generators are available:
|
||||
* [swift2-deprecated (deprecated)](generators/swift2-deprecated.md)
|
||||
* [swift3-deprecated (deprecated)](generators/swift3-deprecated.md)
|
||||
* [swift4](generators/swift4.md)
|
||||
* [typescript](generators/typescript.md)
|
||||
* [typescript-angular](generators/typescript-angular.md)
|
||||
* [typescript-angularjs](generators/typescript-angularjs.md)
|
||||
* [typescript-aurelia](generators/typescript-aurelia.md)
|
||||
@@ -65,7 +66,6 @@ The following generators are available:
|
||||
* [typescript-inversify](generators/typescript-inversify.md)
|
||||
* [typescript-jquery](generators/typescript-jquery.md)
|
||||
* [typescript-node](generators/typescript-node.md)
|
||||
* [typescript-redux-query](generators/typescript-redux-query.md)
|
||||
* [typescript-rxjs](generators/typescript-rxjs.md)
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ sidebar_label: csharp-netcore
|
||||
|returnICollection|Return ICollection<T> instead of the concrete type.| |false|
|
||||
|optionalMethodArgument|C# Optional method argument, e.g. void square(int x=10) (.net 4.0+ only).| |true|
|
||||
|optionalAssemblyInfo|Generate AssemblyInfo.cs.| |true|
|
||||
|optionalEmitDefaultValues|Set DataMember's EmitDefaultValue.| |false|
|
||||
|optionalProjectFile|Generate {PackageName}.csproj.| |true|
|
||||
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.| |false|
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||
|
||||
@@ -12,5 +12,4 @@ sidebar_label: go-experimental
|
||||
|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|enumClassPrefix|Prefix enum with class name| |false|
|
||||
|structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|
||||
@@ -10,4 +10,3 @@ sidebar_label: go-server
|
||||
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|
||||
|sourceFolder|source folder for generated code| |go|
|
||||
|serverPort|The network port the generated server binds to| |8080|
|
||||
|featureCORS|Enable Cross-Origin Resource Sharing middleware| |false|
|
||||
|
||||
@@ -12,5 +12,4 @@ sidebar_label: go
|
||||
|withGoCodegenComment|whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs| |false|
|
||||
|withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false|
|
||||
|enumClassPrefix|Prefix enum with class name| |false|
|
||||
|structPrefix|whether to prefix struct with the class name. e.g. DeletePetOpts => PetApiDeletePetOpts| |false|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|
||||
@@ -11,4 +11,3 @@ sidebar_label: haskell
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|modelPackage|package for generated models| |null|
|
||||
|apiPackage|package for generated api classes| |null|
|
||||
|serveStatic|serve will serve files from the directory 'static'.| |true|
|
||||
|
||||
@@ -15,7 +15,6 @@ sidebar_label: kotlin-server
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd><dl>|ktor|
|
||||
|featureAutoHead|Automatically provide responses to HEAD requests for existing routes that have the GET verb defined.| |true|
|
||||
|featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false|
|
||||
|
||||
@@ -15,7 +15,6 @@ sidebar_label: kotlin-spring
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|title|server title name or client service name| |OpenAPI Kotlin Spring|
|
||||
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
|
||||
|serverPort|configuration the port in which the sever is to run on| |8080|
|
||||
@@ -29,5 +28,4 @@ sidebar_label: kotlin-spring
|
||||
|useBeanValidation|Use BeanValidation API annotations to validate data types| |true|
|
||||
|reactive|use coroutines for reactive behavior| |false|
|
||||
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|
||||
|delegatePattern|Whether to generate the server files using the delegate pattern| |false|
|
||||
|library|library template (sub-template)|<dl><dt>**spring-boot**</dt><dd>Spring-boot Server application.</dd><dl>|spring-boot|
|
||||
|
||||
@@ -15,4 +15,3 @@ sidebar_label: kotlin-vertx
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|
||||
@@ -15,7 +15,6 @@ sidebar_label: kotlin
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|modelMutable|Create mutable models| |false|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**string**</dt><dd>String</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (jvm only)</dd><dt>**threetenbp**</dt><dd>Threetenbp (jvm only)</dd><dl>|java8|
|
||||
|collectionType|Option. Collection type to use|<dl><dt>**array**</dt><dd>kotlin.Array</dd><dt>**list**</dt><dd>kotlin.collections.List</dd><dl>|array|
|
||||
|library|Library template (sub-template) to use|<dl><dt>**jvm-okhttp4**</dt><dd>[DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.</dd><dt>**jvm-okhttp3**</dt><dd>Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0.</dd><dl>|jvm-okhttp4|
|
||||
|
||||
@@ -10,8 +10,7 @@ sidebar_label: swift4
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|projectName|Project name in Xcode| |null|
|
||||
|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift, Result are available.| |null|
|
||||
|nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.(default: false)| |null|
|
||||
|responseAs|Optionally use libraries to manage response. Currently PromiseKit, RxSwift are available.| |null|
|
||||
|unwrapRequired|Treat 'required' properties in response as non-optional (which would crash the app if api returns null as opposed to required option specified in json schema| |null|
|
||||
|objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null|
|
||||
|podSource|Source information used for Podspec| |null|
|
||||
|
||||
@@ -16,7 +16,6 @@ sidebar_label: typescript-angular
|
||||
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|
||||
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|
||||
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|
||||
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false|
|
||||
|taggedUnions|Use discriminators to create tagged unions instead of extending interfaces.| |false|
|
||||
|providedInRoot|Use this property to provide Injectables in root (it is only valid in angular version greater or equal to 6.0.0).| |false|
|
||||
|ngVersion|The version of Angular.| |8.0.0|
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
title: Config Options for typescript-redux-query
|
||||
sidebar_label: typescript-redux-query
|
||||
---
|
||||
|
||||
| Option | Description | Values | Default |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|
||||
|supportsES6|Generate code that conforms to ES6.| |false|
|
||||
|npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null|
|
||||
|npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0|
|
||||
|snapshot|When setting this property to true, the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm| |false|
|
||||
|npmRepository|Use this property to set an url your private npmRepo in the package.json| |null|
|
||||
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
|
||||
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |true|
|
||||
17
docs/generators/typescript.md
Normal file
17
docs/generators/typescript.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
title: Config Options for typescript
|
||||
sidebar_label: typescript
|
||||
---
|
||||
|
||||
| Option | Description | Values | Default |
|
||||
| ------ | ----------- | ------ | ------- |
|
||||
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|
||||
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|
||||
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
|
||||
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
|
||||
|modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase|
|
||||
|supportsES6|Generate code that conforms to ES6.| |false|
|
||||
|fileContentDataType|Specifies the type to use for the content of a file - i.e. Blob (Browser) / Buffer (node)| |Buffer|
|
||||
|useRxJS|Enable this to internally use rxjs observables. If disabled, a stub is used instead. This is required for the 'angular' framework.| |false|
|
||||
|platform|Specifies the platform the code should run on. The default is 'node' for the 'request' framework and 'browser' otherwise.| |null|
|
||||
|framework|Specify the framework which should be used in the client code.|<dl><dt>**fetch-api**</dt><dd>fetch-api</dd><dt>**jquery**</dt><dd>jquery</dd><dl>|fetch-api|
|
||||
@@ -19,14 +19,6 @@ Supported tasks include:
|
||||
|
||||
See the [openapi-generator-maven-plugin README](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/README.md) for details related to configuring and using the Maven Plugin.
|
||||
|
||||
### sbt Integration
|
||||
|
||||
Please refer to https://github.com/upstart-commerce/sbt-openapi-generator
|
||||
|
||||
### Bazel Integration
|
||||
|
||||
Please refer to https://github.com/OpenAPITools/openapi-generator-bazel
|
||||
|
||||
### GitHub Integration
|
||||
|
||||
To push the auto-generated SDK to GitHub, we provide `git_push.sh` to streamline the process. For example:
|
||||
|
||||
@@ -557,85 +557,3 @@ The name of the file should be `config.yml` or `config.yaml` (in our example it
|
||||
openapi-generator generate -i petstore.yaml -g typescript-fetch -o out \
|
||||
-c config.yaml
|
||||
```
|
||||
|
||||
|
||||
## batch
|
||||
|
||||
The `batch` command allows you to move all CLI arguments supported by the `generate` command into a YAML or JSON file.
|
||||
|
||||
*NOTE*: This command supports an additional `!include` property which may point to another "shared" file, the base path to which can be
|
||||
modified by `--includes-base-dir`.
|
||||
|
||||
```bash
|
||||
openapi-generator help batch
|
||||
NAME
|
||||
openapi-generator-cli batch - Generate code in batch via external
|
||||
configs.
|
||||
|
||||
SYNOPSIS
|
||||
openapi-generator-cli batch [--fail-fast]
|
||||
[--includes-base-dir <includes>] [(-r <threads> | --threads <threads>)]
|
||||
[--root-dir <root>] [--timeout <timeout>] [(-v | --verbose)] [--]
|
||||
<configs>...
|
||||
|
||||
OPTIONS
|
||||
--fail-fast
|
||||
fail fast on any errors
|
||||
|
||||
--includes-base-dir <includes>
|
||||
base directory used for includes
|
||||
|
||||
-r <threads>, --threads <threads>
|
||||
thread count
|
||||
|
||||
--root-dir <root>
|
||||
root directory used output/includes (includes can be overridden)
|
||||
|
||||
--timeout <timeout>
|
||||
execution timeout (minutes)
|
||||
|
||||
-v, --verbose
|
||||
verbose mode
|
||||
|
||||
--
|
||||
This option can be used to separate command-line options from the
|
||||
list of argument, (useful when arguments might be mistaken for
|
||||
command-line options
|
||||
|
||||
<configs>
|
||||
Generator configuration files.
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
# create "shared" config
|
||||
mkdir shared && cat > shared/common.yaml <<EOF
|
||||
inputSpec: https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||
additionalProperties:
|
||||
x-ext-name: "Your Name"
|
||||
EOF
|
||||
|
||||
# create "standard" configs
|
||||
cat > kotlin.yaml <<EOF
|
||||
'!include': 'shared/common.yaml'
|
||||
outputDir: out/kotlin
|
||||
generatorName: kotlin
|
||||
artifactId: kotlin-petstore-string
|
||||
additionalProperties:
|
||||
dateLibrary: string
|
||||
serializableModel: "true"
|
||||
EOF
|
||||
|
||||
cat > csharp.yaml <<EOF
|
||||
'!include': 'shared/common.yaml'
|
||||
outputDir: out/csharp-netcore
|
||||
generatorName: csharp-netcore
|
||||
additionalProperties:
|
||||
packageGuid: "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}"
|
||||
useCompareNetObjects: "true"
|
||||
EOF
|
||||
|
||||
# Generate them
|
||||
openapi-generator batch *.yaml
|
||||
```
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>4.2.2</version>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -39,7 +39,6 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
@@ -101,13 +100,6 @@ public class GenerateBatch implements Runnable {
|
||||
numThreads = threads;
|
||||
}
|
||||
|
||||
Path rootDir;
|
||||
if (root != null) {
|
||||
rootDir = Paths.get(root);
|
||||
} else {
|
||||
rootDir = Paths.get(System.getProperty("user.dir"));
|
||||
}
|
||||
|
||||
// This allows us to put meta-configs in a different file from referenced configs.
|
||||
// If not specified, we'll assume it's the parent directory of the first file.
|
||||
File includesDir;
|
||||
@@ -115,16 +107,17 @@ public class GenerateBatch implements Runnable {
|
||||
includesDir = new File(includes);
|
||||
} else {
|
||||
Path first = Paths.get(configs.get(0));
|
||||
if (Files.isRegularFile(first) && !Files.isSymbolicLink(first)) {
|
||||
includesDir = first.toAbsolutePath().getParent().toFile();
|
||||
} else {
|
||||
// Not traversing symbolic links for includes. Falling back to rooted working directory.
|
||||
includesDir = rootDir.toFile();
|
||||
}
|
||||
includesDir = first.getParent().toFile();
|
||||
}
|
||||
|
||||
Path rootDir;
|
||||
if (root != null) {
|
||||
rootDir = Paths.get(root);
|
||||
} else {
|
||||
rootDir = Paths.get(System.getProperty("user.dir"));
|
||||
}
|
||||
|
||||
LOGGER.info(String.format(Locale.ROOT, "Batch generation using up to %d threads.\nIncludes: %s\nRoot: %s", numThreads, includesDir.getAbsolutePath(), rootDir.toAbsolutePath().toString()));
|
||||
LOGGER.info(String.format(Locale.ROOT, "Batch generation using %d threads.\nIncludes: %s\nRoot: %s", numThreads, includesDir.getAbsolutePath(), rootDir.toAbsolutePath().toString()));
|
||||
|
||||
// Create a module which loads our config files, but supports a special "!include" key which can point to an existing config file.
|
||||
// This allows us to create a sort of meta-config which holds configs which are otherwise required at CLI time (via generate task).
|
||||
|
||||
@@ -72,34 +72,15 @@ public class Meta implements Runnable {
|
||||
allowedValues = {"CLIENT", "SERVER", "DOCUMENTATION", "CONFIG", "OTHER"})
|
||||
private String type = "OTHER";
|
||||
|
||||
@Option(name = {"-l", "--language"}, title = "language",
|
||||
description = "the implementation language for the generator class",
|
||||
allowedValues = {"java", "kotlin"}
|
||||
)
|
||||
private String language = "java";
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
final File targetDir = new File(outputFolder);
|
||||
LOGGER.info("writing to folder [{}]", targetDir.getAbsolutePath());
|
||||
|
||||
String mainClass = CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_CAMEL, name) + "Generator";
|
||||
String kebabName = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, name);
|
||||
|
||||
List<SupportingFile> supportingFiles = "kotlin".equals(language) ?
|
||||
List<SupportingFile> supportingFiles =
|
||||
ImmutableList.of(
|
||||
new SupportingFile("kotlin/build_gradle.mustache", "", "build.gradle.kts"),
|
||||
new SupportingFile("kotlin/gradle.properties", "", "gradle.properties"),
|
||||
new SupportingFile("kotlin/settings.mustache", "", "settings.gradle"),
|
||||
new SupportingFile("kotlin/generatorClass.mustache", on(File.separator).join("src/main/kotlin", asPath(targetPackage)), mainClass.concat(".kt")),
|
||||
new SupportingFile("kotlin/generatorClassTest.mustache", on(File.separator).join("src/test/kotlin", asPath(targetPackage)), mainClass.concat("Test.kt")),
|
||||
new SupportingFile("kotlin/README.mustache", "", "README.md"),
|
||||
|
||||
new SupportingFile("api.template", "src/main/resources" + File.separator + name,"api.mustache"),
|
||||
new SupportingFile("model.template", "src/main/resources" + File.separator + name,"model.mustache"),
|
||||
new SupportingFile("myFile.template", String.join(File.separator, "src", "main", "resources", name), "myFile.mustache"),
|
||||
new SupportingFile("services.mustache", "src/main/resources/META-INF/services", CodegenConfig.class.getCanonicalName()))
|
||||
: ImmutableList.of(
|
||||
new SupportingFile("pom.mustache", "", "pom.xml"),
|
||||
new SupportingFile("generatorClass.mustache", on(File.separator).join("src/main/java", asPath(targetPackage)), mainClass.concat(".java")),
|
||||
new SupportingFile("generatorClassTest.mustache", on(File.separator).join("src/test/java", asPath(targetPackage)), mainClass.concat("Test.java")),
|
||||
@@ -116,7 +97,6 @@ public class Meta implements Runnable {
|
||||
.put("generatorPackage", targetPackage)
|
||||
.put("generatorClass", mainClass)
|
||||
.put("name", name)
|
||||
.put("kebabName", kebabName)
|
||||
.put("generatorType", type)
|
||||
.put("fullyQualifiedGeneratorClass", targetPackage + "." + mainClass)
|
||||
.put("openapiGeneratorVersion", currentVersion).build();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>4.2.2</version>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -103,9 +103,7 @@ public class WorkflowSettings {
|
||||
builder.strictSpecBehavior = copy.isStrictSpecBehavior();
|
||||
builder.templatingEngineName = copy.getTemplatingEngineName();
|
||||
builder.ignoreFileOverride = copy.getIgnoreFileOverride();
|
||||
|
||||
// this, and any other collections, must be mutable in the builder.
|
||||
builder.systemProperties = new HashMap<>(copy.getSystemProperties());
|
||||
builder.systemProperties = ImmutableMap.copyOf(copy.getSystemProperties());
|
||||
|
||||
// force builder "with" methods to invoke side effects
|
||||
builder.withTemplateDir(copy.getTemplateDir());
|
||||
@@ -274,8 +272,6 @@ public class WorkflowSettings {
|
||||
private String templateDir;
|
||||
private String templatingEngineName = DEFAULT_TEMPLATING_ENGINE_NAME;
|
||||
private String ignoreFileOverride;
|
||||
|
||||
// NOTE: All collections must be mutable in the builder, and copied to a new immutable collection in .build()
|
||||
private Map<String, String> systemProperties = new HashMap<>();;
|
||||
|
||||
private Builder() {
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.openapitools.codegen.config;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.testng.Assert.*;
|
||||
|
||||
@@ -49,25 +48,6 @@ public class WorkflowSettingsTest {
|
||||
assertTrue(settings.isStrictSpecBehavior());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void newBuilderFromCopyShouldMutateSystemProperties(){
|
||||
WorkflowSettings original = WorkflowSettings.newBuilder()
|
||||
.withOutputDir("output")
|
||||
.withVerbose(true)
|
||||
.withSkipOverwrite(false)
|
||||
.withSystemProperty("first", "1st")
|
||||
.build();
|
||||
|
||||
WorkflowSettings modified = WorkflowSettings.newBuilder(original)
|
||||
.withSystemProperty("second", "2nd")
|
||||
.build();
|
||||
|
||||
Map<String, String> properties = modified.getSystemProperties();
|
||||
assertEquals(properties.size(), 2, "System Properties map should allow mutation when invoked via copy constructor");
|
||||
assertEquals(properties.getOrDefault("first", ""), "1st");
|
||||
assertEquals(properties.getOrDefault("second", ""), "2nd");
|
||||
}
|
||||
|
||||
private void assertOnChangesToDefaults(WorkflowSettings defaults) {
|
||||
WorkflowSettings settings = WorkflowSettings.newBuilder()
|
||||
.withOutputDir("output")
|
||||
|
||||
@@ -45,7 +45,7 @@ compileJava.dependsOn tasks.openApiGenerate
|
||||
[source,group]
|
||||
----
|
||||
plugins {
|
||||
id "org.openapi.generator" version "4.2.2"
|
||||
id "org.openapi.generator" version "4.1.1"
|
||||
}
|
||||
----
|
||||
|
||||
@@ -61,7 +61,7 @@ buildscript {
|
||||
// url "https://plugins.gradle.org/m2/"
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:4.2.0"
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:4.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -626,7 +626,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
classpath('org.openapitools:openapi-generator-gradle-plugin:4.2.0') {
|
||||
classpath('org.openapitools:openapi-generator-gradle-plugin:4.1.1') {
|
||||
exclude group: 'com.google.guava'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.3.20'
|
||||
ext.kotlin_version = '1.2.61'
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
@@ -15,7 +15,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath "gradle.plugin.org.gradle.kotlin:gradle-kotlin-dsl-plugins:1.1.3"
|
||||
classpath "gradle.plugin.org.gradle.kotlin:gradle-kotlin-dsl-plugins:1.0-rc-3"
|
||||
classpath "com.gradle.publish:plugin-publish-plugin:0.10.1"
|
||||
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.20.0"
|
||||
classpath "de.marcphilipp.gradle:nexus-publish-plugin:0.2.0"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=4.2.2
|
||||
openApiGeneratorVersion=4.2.0-SNAPSHOT
|
||||
# /RELEASE_VERSION
|
||||
|
||||
# BEGIN placeholders
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
|
||||
distributionUrl=https\://downloads.gradle.org/distributions/gradle-4.10.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>4.2.2</version>
|
||||
<version>4.2.0-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<properties>
|
||||
<skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
|
||||
<gradleVersion>5.2.1</gradleVersion>
|
||||
<gradleVersion>4.10.2</gradleVersion>
|
||||
</properties>
|
||||
|
||||
<pluginRepositories>
|
||||
|
||||
@@ -11,12 +11,11 @@ gradle openApiGenerate
|
||||
gradle openApiMeta
|
||||
gradle openApiValidate
|
||||
gradle buildGoSdk
|
||||
gradle buildDotnetSdk
|
||||
gradle generateGoWithInvalidSpec
|
||||
```
|
||||
|
||||
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
||||
|
||||
```bash
|
||||
gradle -PopenApiGeneratorVersion=4.2.2 openApiValidate
|
||||
gradle -PopenApiGeneratorVersion=4.1.1 openApiValidate
|
||||
```
|
||||
|
||||
@@ -65,20 +65,6 @@ task buildGoSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTas
|
||||
]
|
||||
}
|
||||
|
||||
task buildDotnetSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
|
||||
generatorName = "csharp-netcore"
|
||||
inputSpec = "$rootDir/petstore-v3.0.yaml".toString()
|
||||
additionalProperties = [
|
||||
packageGuid: "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}",
|
||||
useCompareNetObjects: "true"
|
||||
]
|
||||
outputDir = "$buildDir/csharp-netcore".toString()
|
||||
systemProperties = [
|
||||
models: "",
|
||||
apis : "",
|
||||
]
|
||||
}
|
||||
|
||||
task generateGoWithInvalidSpec(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
|
||||
validateSpec = true
|
||||
generatorName = "go"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# RELEASE_VERSION
|
||||
openApiGeneratorVersion=4.2.0
|
||||
openApiGeneratorVersion=4.1.1
|
||||
# /RELEASE_VERSION
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.openapitools.generator.gradle.plugin.extensions
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.kotlin.dsl.listProperty
|
||||
import org.gradle.kotlin.dsl.mapProperty
|
||||
import org.gradle.kotlin.dsl.property
|
||||
|
||||
/**
|
||||
@@ -67,7 +66,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
|
||||
/**
|
||||
* Sets specified system properties.
|
||||
*/
|
||||
val systemProperties = project.objects.mapProperty<String, String>()
|
||||
val systemProperties = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Path to json configuration file.
|
||||
@@ -109,22 +108,22 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
|
||||
/**
|
||||
* Sets instantiation type mappings.
|
||||
*/
|
||||
val instantiationTypes = project.objects.mapProperty<String, String>()
|
||||
val instantiationTypes = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Sets mappings between OpenAPI spec types and generated code types.
|
||||
*/
|
||||
val typeMappings = project.objects.mapProperty<String, String>()
|
||||
val typeMappings = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Sets additional properties that can be referenced by the mustache templates.
|
||||
*/
|
||||
val additionalProperties = project.objects.mapProperty<String, String>()
|
||||
val additionalProperties = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Sets server variable for server URL template substitution, in the format of name=value,name=value.
|
||||
*/
|
||||
val serverVariables = project.objects.mapProperty<String, String>()
|
||||
val serverVariables = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double.
|
||||
@@ -134,7 +133,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
|
||||
/**
|
||||
* Specifies mappings between a given class and the import that should be used for that class.
|
||||
*/
|
||||
val importMappings = project.objects.mapProperty<String, String>()
|
||||
val importMappings = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Root package for generated code.
|
||||
@@ -189,7 +188,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
|
||||
/**
|
||||
* Specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used.
|
||||
*/
|
||||
val reservedWordsMappings = project.objects.mapProperty<String, String>()
|
||||
val reservedWordsMappings = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.
|
||||
@@ -305,7 +304,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
|
||||
/**
|
||||
* A map of options specific to a generator.
|
||||
*/
|
||||
val configOptions = project.objects.mapProperty<String, String>()
|
||||
val configOptions = project.objects.property<Map<String, String>>()
|
||||
|
||||
init {
|
||||
applyDefaults()
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.internal.logging.text.StyledTextOutput
|
||||
import org.gradle.internal.logging.text.StyledTextOutputFactory
|
||||
import org.gradle.kotlin.dsl.listProperty
|
||||
import org.gradle.kotlin.dsl.mapProperty
|
||||
import org.gradle.kotlin.dsl.property
|
||||
import org.openapitools.codegen.CodegenConstants
|
||||
import org.openapitools.codegen.DefaultGenerator
|
||||
@@ -91,7 +90,7 @@ open class GenerateTask : DefaultTask() {
|
||||
* Sets specified system properties.
|
||||
*/
|
||||
@get:Internal
|
||||
val systemProperties = project.objects.mapProperty<String, String>()
|
||||
val systemProperties = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Path to json configuration file.
|
||||
@@ -141,27 +140,27 @@ open class GenerateTask : DefaultTask() {
|
||||
* Sets instantiation type mappings.
|
||||
*/
|
||||
@get:Internal
|
||||
val instantiationTypes = project.objects.mapProperty<String, String>()
|
||||
val instantiationTypes = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Sets mappings between OpenAPI spec types and generated code types.
|
||||
*/
|
||||
@get:Internal
|
||||
val typeMappings = project.objects.mapProperty<String, String>()
|
||||
val typeMappings = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Sets additional properties that can be referenced by the mustache templates in the format of name=value,name=value.
|
||||
* You can also have multiple occurrences of this option.
|
||||
*/
|
||||
@get:Internal
|
||||
val additionalProperties = project.objects.mapProperty<String, String>()
|
||||
val additionalProperties = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Sets server variable for server URL template substitution, in the format of name=value,name=value.
|
||||
* You can also have multiple occurrences of this option.
|
||||
*/
|
||||
@get:Internal
|
||||
val serverVariables = project.objects.mapProperty<String, String>()
|
||||
val serverVariables = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double.
|
||||
@@ -173,7 +172,7 @@ open class GenerateTask : DefaultTask() {
|
||||
* Specifies mappings between a given class and the import that should be used for that class.
|
||||
*/
|
||||
@get:Internal
|
||||
val importMappings = project.objects.mapProperty<String, String>()
|
||||
val importMappings = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Root package for generated code.
|
||||
@@ -239,7 +238,7 @@ open class GenerateTask : DefaultTask() {
|
||||
* Specifies how a reserved name should be escaped to.
|
||||
*/
|
||||
@get:Internal
|
||||
val reservedWordsMappings = project.objects.mapProperty<String, String>()
|
||||
val reservedWordsMappings = project.objects.property<Map<String, String>>()
|
||||
|
||||
/**
|
||||
* Specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.
|
||||
@@ -373,7 +372,7 @@ open class GenerateTask : DefaultTask() {
|
||||
* A dynamic map of options specific to a generator.
|
||||
*/
|
||||
@get:Internal
|
||||
val configOptions = project.objects.mapProperty<String, String>()
|
||||
val configOptions = project.objects.property<Map<String, String>>()
|
||||
|
||||
private fun <T : Any?> Property<T>.ifNotEmpty(block: Property<T>.(T) -> Unit) {
|
||||
if (isPresent) {
|
||||
|
||||
@@ -12,7 +12,7 @@ Add to your `build->plugins` section (default phase is `generate-sources` phase)
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>4.2.2</version>
|
||||
<version>4.1.1</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>4.2.2</version>
|
||||
<version>4.1.3-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -1,237 +0,0 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>sample-project</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>sample-project</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- activate the plugin -->
|
||||
<plugin>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>4.2.1-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default</id>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- specify the swagger yaml -->
|
||||
<inputSpec>${project.basedir}/swagger.yaml</inputSpec>
|
||||
|
||||
<!-- target to generate java client code -->
|
||||
<generatorName>kotlin</generatorName>
|
||||
|
||||
<!-- hint: if you want to generate java server code, e.g. based on Spring Boot,
|
||||
you can use the following target: <generatorName>spring</generatorName> -->
|
||||
|
||||
<!-- pass any necessary config options -->
|
||||
<configOptions>
|
||||
<serializableModel>true</serializableModel>
|
||||
</configOptions>
|
||||
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>kotlin</id>
|
||||
<phase>generate-sources</phase>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<!-- specify the swagger yaml -->
|
||||
<inputSpec>https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml
|
||||
</inputSpec>
|
||||
|
||||
<!-- target to generate java client code -->
|
||||
<generatorName>kotlin</generatorName>
|
||||
|
||||
<!-- hint: if you want to generate java server code, e.g. based on Spring Boot,
|
||||
you can use the following target: <generatorName>spring</generatorName> -->
|
||||
|
||||
<!-- pass any necessary config options -->
|
||||
<configOptions>
|
||||
<serializableModel>true</serializableModel>
|
||||
</configOptions>
|
||||
|
||||
<output>${project.build.directory}/generated-sources/kotlin</output>
|
||||
<apiPackage>kotlintest.org.openapitools.client.api</apiPackage>
|
||||
<modelPackage>kotlintest.org.openapitools.client.model</modelPackage>
|
||||
<invokerPackage>kotlintest.org.openapitools.client</invokerPackage>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<proc>none</proc>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<configuration>
|
||||
<jvmTarget>${kotlinJvmTarget}</jvmTarget>
|
||||
<javacOptions/>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirs>
|
||||
<sourceDir>${project.build.directory}/generated-sources/kotlin/src/main/kotlin</sourceDir>
|
||||
</sourceDirs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<version>${kotlin.version}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>sonatype-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
<dependencies>
|
||||
<!-- dependencies are needed for the client being generated -->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>${swagger-annotations-version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- You can find the dependencies for the library configuation you chose by looking in JavaClientCodegen.
|
||||
Then find the corresponding dependency on Maven Central, and set the versions in the property section below -->
|
||||
|
||||
<!-- HTTP client: jersey-client -->
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.core</groupId>
|
||||
<artifactId>jersey-client</artifactId>
|
||||
<version>${jersey-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.media</groupId>
|
||||
<artifactId>jersey-media-multipart</artifactId>
|
||||
<version>${jersey-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.media</groupId>
|
||||
<artifactId>jersey-media-json-jackson</artifactId>
|
||||
<version>${jersey-version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- @Nullable annotation -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.findbugs</groupId>
|
||||
<artifactId>jsr305</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- JSON processing: jackson -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
||||
<artifactId>jackson-jaxrs-base</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.jaxrs</groupId>
|
||||
<artifactId>jackson-jaxrs-json-provider</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>jackson-databind-nullable</artifactId>
|
||||
<version>${jackson-databind-nullable-version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Joda time: if you use it -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-joda</artifactId>
|
||||
<version>${jackson-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>${jodatime-version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Base64 encoding that works in both JVM and Android -->
|
||||
<dependency>
|
||||
<groupId>com.brsanthu</groupId>
|
||||
<artifactId>migbase64</artifactId>
|
||||
<version>${migbase64.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.moshi</groupId>
|
||||
<artifactId>moshi-kotlin</artifactId>
|
||||
<version>${moshi-kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.moshi</groupId>
|
||||
<artifactId>moshi-adapters</artifactId>
|
||||
<version>${moshi-kotlin.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.2.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<properties>
|
||||
<swagger-annotations-version>1.5.8</swagger-annotations-version>
|
||||
<jersey-version>2.27</jersey-version>
|
||||
<jackson-version>2.8.9</jackson-version>
|
||||
<jackson-databind-nullable-version>0.2.0</jackson-databind-nullable-version>
|
||||
<jodatime-version>2.7</jodatime-version>
|
||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||
<junit-version>4.8.1</junit-version>
|
||||
<kotlin.version>1.3.50</kotlin.version>
|
||||
<kotlinJvmTarget>1.8</kotlinJvmTarget>
|
||||
<moshi-kotlin.version>1.8.0</moshi-kotlin.version>
|
||||
<migbase64.version>2.2</migbase64.version>
|
||||
</properties>
|
||||
</project>
|
||||
@@ -19,7 +19,7 @@
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<!-- RELEASE_VERSION -->
|
||||
<version>4.2.2</version>
|
||||
<version>4.1.3-SNAPSHOT</version>
|
||||
<!-- /RELEASE_VERSION -->
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user