forked from loafle/openapi-generator-original
Compare commits
85 Commits
v5.0.1
...
ts-refacto
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf2b05defa | ||
|
|
0906e3cbb5 | ||
|
|
8fc7eebbb4 | ||
|
|
4258a17a76 | ||
|
|
fc29d2c133 | ||
|
|
fbed6ca418 | ||
|
|
d9e051938d | ||
|
|
af8f6ff3ef | ||
|
|
3aa2f22d98 | ||
|
|
f8a42315c0 | ||
|
|
86daa2b994 | ||
|
|
21861bd27f | ||
|
|
9705ec9c01 | ||
|
|
d8de81b7c6 | ||
|
|
ae8c1be09d | ||
|
|
33c8d19564 | ||
|
|
dee6ed420e | ||
|
|
41d1864d02 | ||
|
|
56f9737b2d | ||
|
|
e315d48636 | ||
|
|
659369c3ea | ||
|
|
303ec6c04b | ||
|
|
391a191ecf | ||
|
|
934f226098 | ||
|
|
07dd1efb7a | ||
|
|
5a2561f520 | ||
|
|
d704a4ffba | ||
|
|
bfc14c82e5 | ||
|
|
9afb8ff12a | ||
|
|
0000342d77 | ||
|
|
0f3ad99d72 | ||
|
|
4f461f948a | ||
|
|
68241f8c33 | ||
|
|
5fd3be29bd | ||
|
|
e4a0855db9 | ||
|
|
9297e59053 | ||
|
|
6c37c7180d | ||
|
|
fb6f8c5344 | ||
|
|
8d8e57f1f9 | ||
|
|
495ce938f8 | ||
|
|
99c3dceae7 | ||
|
|
fcbecc4dbd | ||
|
|
40f3c4f4dd | ||
|
|
c330a9f872 | ||
|
|
a481d0ce83 | ||
|
|
35d3cc20c9 | ||
|
|
7a372acbed | ||
|
|
56ca583b2e | ||
|
|
c8c58b4f5e | ||
|
|
861f774c56 | ||
|
|
df970ae8b1 | ||
|
|
1d27563a41 | ||
|
|
aeef285190 | ||
|
|
8068315f79 | ||
|
|
e11a5a9395 | ||
|
|
a00e342505 | ||
|
|
7786f2e9fb | ||
|
|
1c2943dcc8 | ||
|
|
c5c9a59060 | ||
|
|
8bfb88cd76 | ||
|
|
35b98cf2bc | ||
|
|
9b0bb9a399 | ||
|
|
e41df36261 | ||
|
|
c2b7422a81 | ||
|
|
525f48d694 | ||
|
|
0867522b0a | ||
|
|
988df1f7a5 | ||
|
|
4c11314a7b | ||
|
|
3eaa5e54ef | ||
|
|
7909cbaec7 | ||
|
|
a6560e5530 | ||
|
|
61a1bbdabe | ||
|
|
a7de49110e | ||
|
|
e40d94984f | ||
|
|
a8ec866117 | ||
|
|
f5b062957d | ||
|
|
d4fa8c7f72 | ||
|
|
6b2a2289f2 | ||
|
|
b89646a223 | ||
|
|
276d7d47e5 | ||
|
|
1cc6fb0421 | ||
|
|
1a31c48ceb | ||
|
|
6638cef37a | ||
|
|
05f64c6732 | ||
|
|
06d9556f13 |
@@ -1,118 +0,0 @@
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
# docker:
|
||||
# #- image: openapitools/openapi-generator
|
||||
# - image: swaggerapi/petstore
|
||||
# environment:
|
||||
# SWAGGER_HOST=http://petstore.swagger.io
|
||||
# SWAGGER_BASE_PATH=/v2
|
||||
machine:
|
||||
image: circleci/classic:latest
|
||||
working_directory: ~/OpenAPITools/openapi-generator
|
||||
parallelism: 3
|
||||
shell: /bin/bash --login
|
||||
environment:
|
||||
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
||||
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
|
||||
DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
|
||||
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
|
||||
steps:
|
||||
# Restore the dependency cache
|
||||
- restore_cache:
|
||||
keys:
|
||||
# Default branch if not
|
||||
- source-v2-{{ .Branch }}-{{ .Revision }}
|
||||
- source-v2-{{ .Branch }}-
|
||||
- source-v2-
|
||||
# Machine Setup
|
||||
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
|
||||
# The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
|
||||
- checkout
|
||||
# Prepare for artifact and test results collection equivalent to how it was done on 1.0.
|
||||
# In many cases you can simplify this from what is generated here.
|
||||
# 'See docs on artifact collection here https://circleci.com/docs/2.0/artifacts/'
|
||||
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS
|
||||
# This is based on your 1.0 configuration file or project settings
|
||||
- run:
|
||||
command: sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java; sudo update-alternatives --set javac /usr/lib/jvm/java-8-openjdk-amd64/bin/javac; echo -e "export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> $BASH_ENV
|
||||
- run:
|
||||
command: 'sudo docker info >/dev/null 2>&1 || sudo service docker start; '
|
||||
- run:
|
||||
command: |-
|
||||
printf '127.0.0.1 petstore.swagger.io
|
||||
' | sudo tee -a /etc/hosts
|
||||
# Dependencies
|
||||
# Install latest stable node for angular 6
|
||||
- run:
|
||||
name: Install node@stable (for angular 6)
|
||||
command: |
|
||||
set +e
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
|
||||
export NVM_DIR="/opt/circleci/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
nvm install stable
|
||||
nvm alias default stable
|
||||
|
||||
# Each step uses the same `$BASH_ENV`, so need to modify it
|
||||
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
|
||||
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
|
||||
- run: node --version
|
||||
# - run: docker pull openapitools/openapi-petstore
|
||||
# - run: docker run -d -e OPENAPI_BASE_PATH=/v3 -e DISABLE_API_KEY=1 -e DISABLE_OAUTH=1 -p 80:8080 openapitools/openapi-petstore
|
||||
- run: docker pull swaggerapi/petstore
|
||||
- run: docker run --name petstore.swagger -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
|
||||
- run: docker ps -a
|
||||
- run: sleep 30
|
||||
- run: cat /etc/hosts
|
||||
# Test
|
||||
- run: mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- run: ./CI/circle_parallel.sh
|
||||
# Save dependency cache
|
||||
- save_cache:
|
||||
key: source-v2-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
# This is a broad list of cache paths to include many possible development environments
|
||||
# You can probably delete some of these entries
|
||||
- vendor/bundle
|
||||
- ~/virtualenvs
|
||||
- ~/.m2
|
||||
- ~/.ivy2
|
||||
- ~/.sbt
|
||||
- ~/.bundle
|
||||
- ~/.go_workspace
|
||||
- ~/.gradle
|
||||
- ~/.cache/bower
|
||||
- ".git"
|
||||
- ~/.stack
|
||||
- /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work
|
||||
- ~/R
|
||||
# save "default" cache using the key "source-v2-"
|
||||
- save_cache:
|
||||
key: source-v2-
|
||||
paths:
|
||||
# This is a broad list of cache paths to include many possible development environments
|
||||
# You can probably delete some of these entries
|
||||
- vendor/bundle
|
||||
- ~/virtualenvs
|
||||
- ~/.m2
|
||||
- ~/.ivy2
|
||||
- ~/.sbt
|
||||
- ~/.bundle
|
||||
- ~/.go_workspace
|
||||
- ~/.gradle
|
||||
- ~/.cache/bower
|
||||
- ".git"
|
||||
- ~/.stack
|
||||
- /home/circleci/OpenAPITools/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work
|
||||
- ~/R
|
||||
# Teardown
|
||||
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
|
||||
# Save test results
|
||||
- store_test_results:
|
||||
path: /tmp/circleci-test-results
|
||||
# Save artifacts
|
||||
- store_artifacts:
|
||||
path: /tmp/circleci-artifacts
|
||||
- store_artifacts:
|
||||
path: /tmp/circleci-test-results
|
||||
26
.github/.test/samples.json
vendored
26
.github/.test/samples.json
vendored
@@ -807,7 +807,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": "php-mezzio-ph-petstore-server.sh",
|
||||
"input": "php-ze-ph-petstore-server.sh",
|
||||
"matches": [
|
||||
"Server: PHP"
|
||||
]
|
||||
@@ -1244,30 +1244,6 @@
|
||||
"Client: TypeScript"
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": "typescript-nestjs-v6-petstore-not-provided-in-root-with-npm.sh",
|
||||
"matches": [
|
||||
"Client: TypeScript"
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": "typescript-nestjs-v6-petstore-not-provided-in-root.sh",
|
||||
"matches": [
|
||||
"Client: TypeScript"
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": "typescript-nestjs-v6-petstore-provided-in-root-with-npm.sh",
|
||||
"matches": [
|
||||
"Client: TypeScript"
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": "typescript-nestjs-v6-petstore-provided-in-root.sh",
|
||||
"matches": [
|
||||
"Client: TypeScript"
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": "typescript-node-petstore-with-npm.sh",
|
||||
"matches": [
|
||||
|
||||
14
.github/ISSUE_TEMPLATE/bug_report.md
vendored
14
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -11,10 +11,10 @@ assignees: ''
|
||||
|
||||
- [ ] Have you provided a full/minimal spec to reproduce the issue?
|
||||
- [ ] Have you validated the input using an OpenAPI validator ([example](https://apidevtools.org/swagger-parser/online/))?
|
||||
- [ ] Have you [tested with the latest master](https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-to-test-with-the-latest-master-of-openapi-generator) to confirm the issue still exists?
|
||||
- [ ] Have you searched for related issues/PRs?
|
||||
- [ ] What's the version of OpenAPI Generator used?
|
||||
- [ ] Have you search for related issues/PRs?
|
||||
- [ ] What's the actual output vs expected output?
|
||||
- [ ] [Optional] Sponsorship to speed up the bug fix or feature request ([example](https://github.com/OpenAPITools/openapi-generator/issues/6178))
|
||||
- [ ] [Optional] Bounty to sponsor the fix ([example](https://www.bountysource.com/issues/66123212-javascript-client-produces-a-wrong-object-for-a-string-enum-type-that-is-used-with-ref))
|
||||
|
||||
<!--
|
||||
Please follow the issue template below for bug reports.
|
||||
@@ -45,13 +45,9 @@ please create a Gist (https://gist.github.com) or upload it somewhere else and
|
||||
link it here.
|
||||
-->
|
||||
|
||||
##### Generation Details
|
||||
##### Command line used for generation
|
||||
|
||||
<!--
|
||||
Prefer CLI steps, including the language, libraries and various options.
|
||||
Providing config-based settings allows for simpler testing across CLI and plugins.
|
||||
For examples, see https://github.com/OpenAPITools/openapi-generator/tree/master/bin/configs
|
||||
-->
|
||||
<!-- including the language, libraries and various options -->
|
||||
|
||||
##### Steps to reproduce
|
||||
|
||||
|
||||
20
.github/PULL_REQUEST_TEMPLATE.md
vendored
20
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -2,19 +2,9 @@
|
||||
|
||||
<!-- Please check the completed items below -->
|
||||
### PR checklist
|
||||
|
||||
|
||||
- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
|
||||
- [ ] Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
|
||||
- [ ] Run the following to [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) and update samples:
|
||||
```
|
||||
./mvnw clean package
|
||||
./bin/generate-samples.sh
|
||||
./bin/utils/export_docs_generators.sh
|
||||
```
|
||||
Commit all changed files.
|
||||
This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master.
|
||||
These must match the expectations made by your contribution.
|
||||
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`.
|
||||
For Windows users, please run the script in [Git BASH](https://gitforwindows.org/).
|
||||
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `5.1.x`, `6.0.x`
|
||||
- [ ] If your PR is targeting a particular programming language, @mention the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request.
|
||||
- [ ] 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`.
|
||||
- [ ] 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.
|
||||
|
||||
94
.github/workflows/check-supported-versions.yaml
vendored
94
.github/workflows/check-supported-versions.yaml
vendored
@@ -1,94 +0,0 @@
|
||||
name: Check Supported Java Versions
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: 'Build: JDK ${{ matrix.java }} (${{ matrix.os }})'
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
java: [8, 11]
|
||||
os: [ubuntu-latest]
|
||||
include:
|
||||
- java: 8
|
||||
os: windows-latest
|
||||
- java: 13
|
||||
os: ubuntu-latest
|
||||
# Need to update to Gradle version with v13 support in modules/openapi-generator-gradle-plugin/pom.xml
|
||||
flags: -am -pl modules/openapi-generator-cli
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Set up JDK ${{ matrix.java }}
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: ${{ runner.os }}-gradle-${{ hashFiles('modules/openapi-generator-gradle-plugin/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gradle-
|
||||
|
||||
- name: Build with Maven
|
||||
shell: bash
|
||||
run: mvn -nsu -B --quiet -Djacoco.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error --no-transfer-progress clean install --file pom.xml ${{ matrix.flags }}
|
||||
|
||||
- name: Upload Maven build artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
if: matrix.java == '8' && matrix.os == 'ubuntu-latest'
|
||||
with:
|
||||
name: artifact
|
||||
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
|
||||
|
||||
- name: Test Gradle plugin usage
|
||||
shell: bash
|
||||
run: gradle -b modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle buildGoSdk --stacktrace
|
||||
|
||||
- name: Test Maven plugin integration
|
||||
if: matrix.java == '8'
|
||||
shell: bash
|
||||
run: |
|
||||
cd modules/openapi-generator-maven-plugin
|
||||
mvn verify -Pintegration
|
||||
|
||||
verify:
|
||||
name: Verify outputs on ${{ matrix.os }}
|
||||
needs: build
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
# include:
|
||||
# - os: windows-latest
|
||||
# flags: --skip-docs
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
- name: Download build artifact
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: artifact
|
||||
- name: Run Ensures Script
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global core.fileMode false
|
||||
git config --global core.safecrlf false
|
||||
git config --global core.autocrlf true
|
||||
mkdir -p modules/openapi-generator-cli/target/
|
||||
mv artifact/openapi-generator-cli.jar modules/openapi-generator-cli/target/
|
||||
./bin/utils/ensure-up-to-date ${{ matrix.flags }}
|
||||
75
.github/workflows/docker-tag-latest-release.yml
vendored
75
.github/workflows/docker-tag-latest-release.yml
vendored
@@ -1,75 +0,0 @@
|
||||
name: Docker Tag latest-release
|
||||
|
||||
# Run every couple of days
|
||||
on:
|
||||
schedule:
|
||||
- cron: "30 12 */2 * *"
|
||||
|
||||
jobs:
|
||||
# This pulls all containers for the last known release tag, and tags as latest-release or x-latest-release for shared repo
|
||||
tagLatestRelease:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
# Pull the code so we have git metadata
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# This action will "unshallow" so we have all tag info
|
||||
- name: Get latest tag
|
||||
id: tagger
|
||||
uses: jimschubert/query-tag-action@v1
|
||||
with:
|
||||
include: 'v*'
|
||||
exclude: '*-rc*'
|
||||
commit-ish: 'HEAD~'
|
||||
|
||||
- name: DockerHub Login
|
||||
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
|
||||
|
||||
# Tags openapitools/openapi-generator-cli
|
||||
- name: "Tag openapi-generator-cli:x"
|
||||
id: tag-openapi-generator-cli
|
||||
if: always()
|
||||
run: |
|
||||
echo 'Tagging as latest-release: ${{steps.tagger.outputs.tag}}'
|
||||
docker pull openapitools/openapi-generator-cli:${{steps.tagger.outputs.tag}}
|
||||
docker tag openapitools/openapi-generator-cli:${{steps.tagger.outputs.tag}} openapitools/openapi-generator-cli:latest-release
|
||||
docker push openapitools/openapi-generator-cli:latest-release
|
||||
|
||||
# Tags openapitools/openapi-generator-online
|
||||
- name: "Tag openapi-generator-online:x"
|
||||
id: tag-openapi-generator-online
|
||||
if: always()
|
||||
run: |
|
||||
echo 'Tagging as latest-release: ${{steps.tagger.outputs.tag}}'
|
||||
docker pull openapitools/openapi-generator-online:${{steps.tagger.outputs.tag}}
|
||||
docker tag openapitools/openapi-generator-online:${{steps.tagger.outputs.tag}} openapitools/openapi-generator-online:latest-release
|
||||
docker push openapitools/openapi-generator-online:latest-release
|
||||
|
||||
# Tags openapitools/openapi-generator's CLI image (this repo holds CLI + Online via tag prefix)
|
||||
- name: "Tag openapi-generator:cli-x"
|
||||
id: tag-cli
|
||||
if: always()
|
||||
run: |
|
||||
echo 'Tagging as latest-release: ${{steps.tagger.outputs.tag}}'
|
||||
docker pull openapitools/openapi-generator:cli-${{steps.tagger.outputs.tag}}
|
||||
docker tag openapitools/openapi-generator:cli-${{steps.tagger.outputs.tag}} openapitools/openapi-generator:cli-latest-release
|
||||
docker push openapitools/openapi-generator:cli-latest-release
|
||||
|
||||
# Tags openapitools/openapi-generator's ONLINE image (this repo holds CLI + Online via tag prefix)
|
||||
- name: "Tag openapi-generator:online-x"
|
||||
id: tag-online
|
||||
if: always()
|
||||
run: |
|
||||
echo 'Tagging as latest-release: ${{steps.tagger.outputs.tag}}'
|
||||
docker pull openapitools/openapi-generator:online-${{steps.tagger.outputs.tag}}
|
||||
docker tag openapitools/openapi-generator:online-${{steps.tagger.outputs.tag}} openapitools/openapi-generator:online-latest-release
|
||||
docker push openapitools/openapi-generator:online-latest-release
|
||||
|
||||
# Clean up docker credentials/configs/etc.
|
||||
- name: Cleanup
|
||||
if: always()
|
||||
run: |
|
||||
rm -f ${HOME}/.docker/config.json
|
||||
9
.github/workflows/sonar.yml
vendored
9
.github/workflows/sonar.yml
vendored
@@ -4,7 +4,6 @@ on:
|
||||
branches:
|
||||
- master
|
||||
- '[4-9]+.[0-9]+.x'
|
||||
- sonar
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -13,13 +12,13 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Set up JDK 11
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
java-version: 1.8
|
||||
- name: Compile with Maven
|
||||
run: mvn -B -q clean install jacoco:report
|
||||
run: mvn clean package jacoco:report
|
||||
- name: Jacoco Aggregate
|
||||
run: mvn jacoco:report-aggregate
|
||||
- name: Publish to Sonar
|
||||
run: mvn -B -q -nsu sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${GITHUB_REF##*/}
|
||||
run: mvn -B -q sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${GITHUB_REF##*/}
|
||||
|
||||
32
.gitignore
vendored
32
.gitignore
vendored
@@ -31,7 +31,6 @@ packages/
|
||||
.vscode/
|
||||
**/.vs
|
||||
.factorypath
|
||||
.metals/*
|
||||
|
||||
.settings
|
||||
|
||||
@@ -174,21 +173,10 @@ samples/client/petstore/python-asyncio/.venv/
|
||||
samples/client/petstore/python-asyncio/.pytest_cache/
|
||||
samples/client/petstore/python-tornado/.venv/
|
||||
|
||||
# PHP
|
||||
samples/client/petstore/php/OpenAPIClient-php/composer.lock
|
||||
samples/openapi3/server/petstore/php-symfony/SymfonyBundle-php/composer.lock
|
||||
samples/openapi3/server/petstore/php-mezzio-ph/composer.lock
|
||||
samples/server/petstore/php-laravel/lib/composer.lock
|
||||
samples/server/petstore/php-lumen/lib/composer.lock
|
||||
samples/server/petstore/php-slim4/composer.lock
|
||||
samples/server/petstore/php-symfony/SymfonyBundle-php/composer.lock
|
||||
samples/server/petstore/php-mezzio-ph/composer.lock
|
||||
|
||||
# ts
|
||||
samples/client/petstore/typescript-angular2/npm/npm-debug.log
|
||||
samples/client/petstore/typescript-node/npm/npm-debug.log
|
||||
samples/client/petstore/typescript-angular/tsd-debug.log
|
||||
samples/client/petstore/typescript-axios/tests/**/dist/
|
||||
samples/client/petstore/typescript-fetch/tests/**/dist/
|
||||
|
||||
# aspnetcore
|
||||
@@ -235,19 +223,14 @@ samples/client/petstore/erlang-proper/rebar.lock
|
||||
samples/server/petstore/erlang-server/_build/
|
||||
samples/server/petstore/erlang-server/rebar.lock
|
||||
|
||||
# Dart
|
||||
**/dart*/**/.dart_tool
|
||||
**/dart*/**/.packages
|
||||
**/dart*/**/pubspec.lock
|
||||
# Dart dio
|
||||
**/dart*/**/*.g.dart
|
||||
# Dart jaguar
|
||||
**/dart*/**/*.jser.dart
|
||||
**/dart*/**/*.jretro.dart
|
||||
# dart
|
||||
samples/client/petstore/dart/petstore/packages
|
||||
samples/client/petstore/dart/flutter_petstore/test/packages
|
||||
samples/client/petstore/dart/petstore/test/packages
|
||||
**/.dart_tool
|
||||
|
||||
# JS
|
||||
samples/client/petstore/javascript-es6/package-lock.json
|
||||
samples/client/petstore/javascript-promise-es6/package-lock.json
|
||||
samples/client/petstore/javascript/package-lock.json
|
||||
|
||||
# elm
|
||||
samples/client/petstore/elm/index.html
|
||||
@@ -259,6 +242,3 @@ samples/client/petstore/c/*.so
|
||||
# Ruby
|
||||
samples/openapi3/client/petstore/ruby/Gemfile.lock
|
||||
samples/openapi3/client/petstore/ruby-faraday/Gemfile.lock
|
||||
|
||||
# Crystal
|
||||
samples/client/petstore/crystal/lib
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
##
|
||||
## You can build _just_ this part with:
|
||||
## docker --target builder -t container-name:builder -f .hub.cli.dockerfile .
|
||||
FROM maven:3.6.3-jdk-11-openj9 as builder
|
||||
FROM jimschubert/8-jdk-alpine-mvn:1.0 as builder
|
||||
|
||||
RUN set -x && \
|
||||
apk add --no-cache bash
|
||||
|
||||
ENV GEN_DIR /opt/openapi-generator
|
||||
WORKDIR ${GEN_DIR}
|
||||
@@ -15,10 +18,11 @@ RUN mvn -am -pl "modules/openapi-generator-cli" package
|
||||
## The final (release) image
|
||||
## The resulting container here only needs the target jar
|
||||
## and ca-certificates (to be able to query HTTPS hosted specs)
|
||||
FROM openjdk:11.0.8-jre-slim-buster
|
||||
FROM openjdk:8-jre-alpine
|
||||
|
||||
ENV GEN_DIR /opt/openapi-generator
|
||||
|
||||
RUN apk --no-cache add ca-certificates bash
|
||||
RUN mkdir -p ${GEN_DIR}/modules/openapi-generator-cli/target
|
||||
|
||||
WORKDIR ${GEN_DIR}/modules/openapi-generator-cli/target
|
||||
|
||||
@@ -3,7 +3,10 @@
|
||||
##
|
||||
## You can build _just_ this part with:
|
||||
## docker --target builder -t container-name:builder -f .hub.online.dockerfile .
|
||||
FROM maven:3.6.3-jdk-11-openj9 as builder
|
||||
FROM jimschubert/8-jdk-alpine-mvn:1.0 as builder
|
||||
|
||||
RUN set -x && \
|
||||
apk add --no-cache bash
|
||||
|
||||
ENV GEN_DIR /opt/openapi-generator
|
||||
WORKDIR ${GEN_DIR}
|
||||
@@ -14,7 +17,7 @@ RUN mvn -am -pl "modules/openapi-generator-online" package
|
||||
|
||||
## The final (release) image
|
||||
## The resulting container here only needs the target jar
|
||||
FROM openjdk:11.0.8-jre-slim-buster
|
||||
FROM openjdk:8-jre-alpine
|
||||
|
||||
ENV GEN_DIR /opt/openapi-generator
|
||||
ENV TARGET_DIR /generator
|
||||
|
||||
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
@@ -1,117 +0,0 @@
|
||||
/*
|
||||
* Copyright 2007-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
import java.nio.channels.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class MavenWrapperDownloader {
|
||||
|
||||
private static final String WRAPPER_VERSION = "0.5.6";
|
||||
/**
|
||||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||
*/
|
||||
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||
|
||||
/**
|
||||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||
* use instead of the default one.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||
".mvn/wrapper/maven-wrapper.properties";
|
||||
|
||||
/**
|
||||
* Path where the maven-wrapper.jar will be saved to.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||
".mvn/wrapper/maven-wrapper.jar";
|
||||
|
||||
/**
|
||||
* Name of the property which should be used to override the default download url for the wrapper.
|
||||
*/
|
||||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println("- Downloader started");
|
||||
File baseDirectory = new File(args[0]);
|
||||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||
|
||||
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||
// wrapperUrl parameter.
|
||||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||
String url = DEFAULT_DOWNLOAD_URL;
|
||||
if(mavenWrapperPropertyFile.exists()) {
|
||||
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||
try {
|
||||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||
Properties mavenWrapperProperties = new Properties();
|
||||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||
} catch (IOException e) {
|
||||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||
} finally {
|
||||
try {
|
||||
if(mavenWrapperPropertyFileInputStream != null) {
|
||||
mavenWrapperPropertyFileInputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Ignore ...
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading from: " + url);
|
||||
|
||||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||
if(!outputFile.getParentFile().exists()) {
|
||||
if(!outputFile.getParentFile().mkdirs()) {
|
||||
System.out.println(
|
||||
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||
try {
|
||||
downloadFileFromURL(url, outputFile);
|
||||
System.out.println("Done");
|
||||
System.exit(0);
|
||||
} catch (Throwable e) {
|
||||
System.out.println("- Error downloading");
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||
String username = System.getenv("MVNW_USERNAME");
|
||||
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
@Override
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(username, password);
|
||||
}
|
||||
});
|
||||
}
|
||||
URL website = new URL(urlString);
|
||||
ReadableByteChannel rbc;
|
||||
rbc = Channels.newChannel(website.openStream());
|
||||
FileOutputStream fos = new FileOutputStream(destination);
|
||||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||
fos.close();
|
||||
rbc.close();
|
||||
}
|
||||
|
||||
}
|
||||
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Binary file not shown.
3
.mvn/wrapper/maven-wrapper.properties
vendored
3
.mvn/wrapper/maven-wrapper.properties
vendored
@@ -1,2 +1 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
||||
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-bin.zip
|
||||
58
.travis.yml
58
.travis.yml
@@ -24,7 +24,6 @@ cache:
|
||||
- $HOME/samples/openapi3/client/petstore/typescript/tests/default/node_modules
|
||||
- $HOME/samples/openapi3/client/petstore/typescript/tests/jquery/node_modules
|
||||
- $HOME/samples/openapi3/client/petstore/typescript/tests/object_params/node_modules
|
||||
- $HOME/samples/openapi3/client/petstore/typescript/tests/inversify/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
|
||||
@@ -45,7 +44,6 @@ cache:
|
||||
- $HOME/.npm
|
||||
- $HOME/.rvm/gems/ruby-2.4.1
|
||||
- $HOME/website/node_modules/
|
||||
- $HOME/.cache/deno
|
||||
|
||||
services:
|
||||
- docker
|
||||
@@ -62,37 +60,26 @@ addons:
|
||||
- petstore.swagger.io
|
||||
|
||||
before_install:
|
||||
# to run petstore server locally via docker
|
||||
- echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin || true
|
||||
- docker pull swaggerapi/petstore
|
||||
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
|
||||
- docker ps -a
|
||||
# install crystal
|
||||
- curl -sSL https://dist.crystal-lang.org/apt/setup.sh | sudo bash
|
||||
- curl -sL "https://keybase.io/crystal/pgp_keys.asc" | sudo apt-key add -
|
||||
- echo "deb https://dist.crystal-lang.org/apt crystal main" | sudo tee /etc/apt/sources.list.d/crystal.list
|
||||
- sudo apt-get update
|
||||
- sudo apt install crystal
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.0
|
||||
- export PATH="$HOME/.yarn/bin:$PATH"
|
||||
# install rust
|
||||
- curl https://sh.rustup.rs -sSf | sh -s -- -y -v
|
||||
# required when sudo: required for the Ruby petstore tests
|
||||
- gem install bundler
|
||||
- nvm install 12.20.0
|
||||
- nvm use 12.20.0
|
||||
- npm install -g typescript
|
||||
- npm install -g npm
|
||||
- npm config set registry http://registry.npmjs.org/
|
||||
# set python 3.6.3 as default
|
||||
- source ~/virtualenv/python3.6/bin/activate
|
||||
# -- skip bash test to shorten build time
|
||||
# to run petstore server locally via docker
|
||||
- docker pull swaggerapi/petstore
|
||||
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
|
||||
- docker ps -a
|
||||
# Add bats test framework and cURL for Bash script integration tests
|
||||
#- sudo add-apt-repository ppa:duggan/bats --yes
|
||||
#- sudo apt-get update -qq
|
||||
#- sudo apt-get install -qq bats
|
||||
#- sudo apt-get install -qq curl
|
||||
# -- skip bash test end
|
||||
- sudo add-apt-repository ppa:duggan/bats --yes
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq bats
|
||||
- sudo apt-get install -qq curl
|
||||
# install dart
|
||||
#- sudo apt-get update
|
||||
#- sudo apt-get install apt-transport-https
|
||||
@@ -101,9 +88,11 @@ before_install:
|
||||
#- sudo apt-get update
|
||||
#- sudo apt-get install dart
|
||||
# switch to php7
|
||||
- phpenv versions
|
||||
- phpenv global 7.2.15
|
||||
- phpenv global 7.1
|
||||
- php -v
|
||||
# install perl module
|
||||
#- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
|
||||
#- cpanm Test::Exception Test::More Log::Any LWP::UserAgent JSON URI:Query Module::Runtime DateTime Module::Find Moose::Role
|
||||
# comment out below as installation failed in travis
|
||||
# Add rebar3 build tool and recent Erlang/OTP for Erlang petstore server tests.
|
||||
# - Travis CI does not support rebar3 [yet](https://github.com/travis-ci/travis-ci/issues/6506#issuecomment-275189490).
|
||||
@@ -115,11 +104,9 @@ before_install:
|
||||
# install Qt5
|
||||
- sudo apt install -y --no-install-recommends qt5-default
|
||||
- cmake --version
|
||||
# -- skip perl test to shorten build time
|
||||
# perl dep
|
||||
#- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
|
||||
#- cpanm --quiet --no-interactive Test::Exception Test::More Log::Any LWP::UserAgent URI::Query Module::Runtime DateTime Module::Find Moose::Role JSON || echo "Igorned failure from cpanm"
|
||||
# -- skip perl test end
|
||||
- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
|
||||
- cpanm --quiet --no-interactive Test::Exception Test::More Log::Any LWP::UserAgent URI::Query Module::Runtime DateTime Module::Find Moose::Role JSON || echo "Igorned failure from cpanm"
|
||||
# show host table to confirm petstore.swagger.io is mapped to localhost
|
||||
- cat /etc/hosts
|
||||
# show java version
|
||||
@@ -130,9 +117,6 @@ before_install:
|
||||
gpg --check-trustdb ;
|
||||
fi;
|
||||
- pushd .; cd website; yarn install; popd
|
||||
# install Deno
|
||||
- sh -s v1.6.2 < ./CI/deno_install.sh
|
||||
- export PATH="$HOME/.deno/bin:$PATH"
|
||||
|
||||
install:
|
||||
# Add Godeps dependencies to GOPATH and PATH
|
||||
@@ -149,8 +133,6 @@ install:
|
||||
script:
|
||||
# fail fast
|
||||
- set -e
|
||||
# fail if the test files have changes
|
||||
- bin/utils/detect_test_file_changes.rb bin/utils/test_file_list.yaml
|
||||
# fail if templates/generators contain carriage return '\r'
|
||||
- /bin/bash ./bin/utils/detect_carriage_return.sh
|
||||
# fail if generators contain merge conflicts
|
||||
@@ -159,8 +141,16 @@ script:
|
||||
- /bin/bash ./bin/utils/detect_tab_in_java_class.sh
|
||||
# run integration tests defined in maven pom.xml
|
||||
# WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet.
|
||||
- mvn -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn -e --no-snapshot-updates --quiet --batch-mode --show-version verify -Psamples -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --no-snapshot-updates --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --no-snapshot-updates --quiet --batch-mode --show-version verify -Psamples -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
# test maven plugin
|
||||
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
# 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)
|
||||
after_success:
|
||||
# push to maven repo
|
||||
- if [ $SONATYPE_USERNAME ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
||||
|
||||
@@ -2,20 +2,6 @@ kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
# test nim client
|
||||
- name: nim-client-test
|
||||
image: nimlang/nim
|
||||
commands:
|
||||
- (cd samples/client/petstore/nim/ && nim c sample_client.nim)
|
||||
# test protobuf schema generator
|
||||
- name: protobuf-schema-test
|
||||
image: nanoservice/protobuf-go
|
||||
commands:
|
||||
- protoc --version
|
||||
- mkdir /var/tmp/go/
|
||||
- cd samples/config/petstore/protobuf-schema
|
||||
- protoc --go_out=/var/tmp/go/ services/*
|
||||
- protoc --go_out=/var/tmp/go/ models/*
|
||||
# test aspnetcore 3.x
|
||||
- name: aspnetcore-test
|
||||
image: mcr.microsoft.com/dotnet/core/sdk:3.1
|
||||
@@ -42,17 +28,16 @@ steps:
|
||||
- name: java11-test
|
||||
image: openjdk:11.0
|
||||
commands:
|
||||
- ./mvnw --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- ./mvnw -quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
- ./mvnw --quiet verify -Psamples.droneio -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
# test java native client
|
||||
- ./mvnw clean test -f samples/client/petstore/java/native/pom.xml
|
||||
- ./mvnw clean test -f samples/client/petstore/java/native-async/pom.xml
|
||||
- ./mvnw clean test -f samples/openapi3/client/petstore/java/native/pom.xml
|
||||
# test all generators with fake petstore spec (2.0, 3.0)
|
||||
- /bin/bash bin/utils/test-fake-petstore-for-all.sh
|
||||
# generate test scripts
|
||||
- /bin/bash bin/tests/run-all-test
|
||||
# generate all petstore samples (client, servers, doc)
|
||||
- /bin/bash bin/generate-samples.sh
|
||||
- /bin/bash bin/run-all-petstore
|
||||
# generate all petstore samples (openapi3)
|
||||
- /bin/bash bin/generate-samples.sh bin/configs/other/*.yaml
|
||||
- /bin/bash bin/openapi3/run-all-petstore
|
||||
|
||||
61
CI/bitrise.yml
Normal file
61
CI/bitrise.yml
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
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 --no-snapshot-updates package -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
title: Build openapi-generator
|
||||
- script@1.1.5:
|
||||
title: Update Swift samples
|
||||
inputs:
|
||||
- content: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
sh bin/swift5-all.sh
|
||||
- script@1.1.5:
|
||||
title: Run Swift5 tests
|
||||
inputs:
|
||||
- content: |
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
./samples/client/test/swift5/swift5_test_all.sh
|
||||
# comment out the following as it's causing timeout
|
||||
# - script@1.1.5:
|
||||
# title: Run all bin scripts
|
||||
# inputs:
|
||||
# - content: |-
|
||||
# #!/usr/bin/env bash
|
||||
#
|
||||
# set -e
|
||||
#
|
||||
# ./bin/run-all-petstore
|
||||
|
||||
@@ -17,11 +17,15 @@ trap cleanup EXIT
|
||||
if [ "$NODE_INDEX" = "1" ]; then
|
||||
echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..."
|
||||
java -version
|
||||
# Install golang version 1.14
|
||||
go version
|
||||
sudo mkdir /usr/local/go1.14
|
||||
wget -c https://dl.google.com/go/go1.14.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.14
|
||||
export PATH="/usr/local/go1.14/go/bin:$PATH"
|
||||
go version
|
||||
|
||||
mvn --no-snapshot-updates --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
|
||||
echo "show ivy2 cache"
|
||||
ls -l /home/circleci/.ivy2/cache
|
||||
mvn --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
|
||||
elif [ "$NODE_INDEX" = "2" ]; then
|
||||
# run ensure-up-to-date sample script on SNAPSHOT version only
|
||||
@@ -36,19 +40,19 @@ elif [ "$NODE_INDEX" = "2" ]; then
|
||||
# look for outdated samples
|
||||
./bin/utils/ensure-up-to-date
|
||||
fi
|
||||
#elif [ "$NODE_INDEX" = "3" ]; then
|
||||
echo "Running node $NODE_INDEX to test haskell"
|
||||
# install haskell
|
||||
curl -sSL https://get.haskellstack.org/ | sh
|
||||
stack upgrade
|
||||
stack --version
|
||||
# prepare r
|
||||
# install r
|
||||
sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'
|
||||
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
|
||||
gpg -a --export E084DAB9 | sudo apt-key add -
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install r-base
|
||||
R --version
|
||||
|
||||
# install curl
|
||||
sudo apt-get -y build-dep libcurl4-gnutls-dev
|
||||
sudo apt-get -y install libcurl4-gnutls-dev
|
||||
@@ -56,17 +60,10 @@ elif [ "$NODE_INDEX" = "2" ]; then
|
||||
# run integration tests
|
||||
mvn --no-snapshot-updates --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
else
|
||||
echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..."
|
||||
#sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
|
||||
echo "Running node $NODE_INDEX to test 'samples.circleci.jdk7' defined in pom.xml ..."
|
||||
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
|
||||
java -version
|
||||
|
||||
# Install golang version 1.14
|
||||
go version
|
||||
sudo mkdir /usr/local/go1.14
|
||||
wget -c https://dl.google.com/go/go1.14.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.14
|
||||
export PATH="/usr/local/go1.14/go/bin:$PATH"
|
||||
go version
|
||||
|
||||
# install dart2
|
||||
sudo apt-get update
|
||||
sudo apt-get install apt-transport-https
|
||||
@@ -76,8 +73,7 @@ else
|
||||
sudo apt-get install dart
|
||||
export PATH="$PATH:/usr/lib/dart/bin"
|
||||
|
||||
mvn --no-snapshot-updates --quiet verify -Psamples.circleci.others -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
mvn --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
mvn --no-snapshot-updates --quiet verify -Psamples.circleci.jdk7 -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright 2019 the Deno authors. All rights reserved. MIT license.
|
||||
# TODO(everyone): Keep this script simple and easily auditable.
|
||||
|
||||
set -e
|
||||
|
||||
if ! command -v unzip >/dev/null; then
|
||||
echo "Error: unzip is required to install Deno (see: https://github.com/denoland/deno_install#unzip-is-required)." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$OS" = "Windows_NT" ]; then
|
||||
target="x86_64-pc-windows-msvc"
|
||||
else
|
||||
case $(uname -s) in
|
||||
Darwin) target="x86_64-apple-darwin" ;;
|
||||
*) target="x86_64-unknown-linux-gnu" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
deno_uri="https://github.com/denoland/deno/releases/latest/download/deno-${target}.zip"
|
||||
else
|
||||
deno_uri="https://github.com/denoland/deno/releases/download/${1}/deno-${target}.zip"
|
||||
fi
|
||||
|
||||
deno_install="${DENO_INSTALL:-$HOME/.deno}"
|
||||
bin_dir="$deno_install/bin"
|
||||
exe="$bin_dir/deno"
|
||||
|
||||
if [ ! -d "$bin_dir" ]; then
|
||||
mkdir -p "$bin_dir"
|
||||
fi
|
||||
|
||||
curl --fail --location --progress-bar --output "$exe.zip" "$deno_uri"
|
||||
unzip -d "$bin_dir" -o "$exe.zip"
|
||||
chmod +x "$exe"
|
||||
rm "$exe.zip"
|
||||
|
||||
echo "Deno was installed successfully to $exe"
|
||||
if command -v deno >/dev/null; then
|
||||
echo "Run 'deno --help' to get started"
|
||||
else
|
||||
case $SHELL in
|
||||
/bin/zsh) shell_profile=".zshrc" ;;
|
||||
*) shell_profile=".bash_profile" ;;
|
||||
esac
|
||||
echo "Manually add the directory to your \$HOME/$shell_profile (or similar)"
|
||||
echo " export DENO_INSTALL=\"$deno_install\""
|
||||
echo " export PATH=\"\$DENO_INSTALL/bin:\$PATH\""
|
||||
echo "Run '$exe --help' to get started"
|
||||
fi
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
|
||||
-->
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Org.OpenAPITools\Org.OpenAPITools.csproj">
|
||||
<Name>Org.OpenAPITools</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="linux-logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Org.OpenAPITools.Test")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Org.OpenAPITools.Test")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Org.OpenAPITools.Test")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
19e887ae0fddb9fd03c4341951ee9077703a652f
|
||||
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
|
||||
-->
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Org.OpenAPITools\Org.OpenAPITools.csproj">
|
||||
<Name>Org.OpenAPITools</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="linux-logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Org.OpenAPITools.Test")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Org.OpenAPITools.Test")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Org.OpenAPITools.Test")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
19e887ae0fddb9fd03c4341951ee9077703a652f
|
||||
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
|
||||
-->
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{19F1DEBC-DE5E-4517-8062-F000CD499087}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Org.OpenAPITools.Test</RootNamespace>
|
||||
<AssemblyName>Org.OpenAPITools.Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="JsonSubTypes">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RestSharp">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\packages')">..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\packages')">..\..\packages\NUnit.3.11.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\NUnit.3.11.0\lib\net45\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs"
|
||||
Exclude="obj\**"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Org.OpenAPITools\Org.OpenAPITools.csproj">
|
||||
<Project>{321C8C3F-0156-40C1-AE42-D59761FB9B6C}</Project>
|
||||
<Name>Org.OpenAPITools</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="linux-logo.png" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Binary file not shown.
122
CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle
Normal file
122
CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle
Normal file
@@ -0,0 +1,122 @@
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
group = 'org.openapitools'
|
||||
version = '1.0.0'
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter {
|
||||
url "https://jcenter.bintray.com/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.+'
|
||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
jcenter {
|
||||
url "http://jcenter.bintray.com/"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(hasProperty('target') && target == 'android') {
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.github.dcendents.android-maven'
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion '25.0.2'
|
||||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 25
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_6
|
||||
targetCompatibility JavaVersion.VERSION_1_6
|
||||
}
|
||||
|
||||
// Rename the aar correctly
|
||||
libraryVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def outputFile = output.outputFile
|
||||
if (outputFile != null && outputFile.name.endsWith('.aar')) {
|
||||
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
|
||||
output.outputFile = new File(outputFile.parent, fileName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
provided 'javax.annotation:jsr250-api:1.0'
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
android.libraryVariants.all { variant ->
|
||||
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
|
||||
task.description = "Create jar artifact for ${variant.name}"
|
||||
task.dependsOn variant.javaCompile
|
||||
task.from variant.javaCompile.destinationDir
|
||||
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
|
||||
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
|
||||
artifacts.add('archives', task);
|
||||
}
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
from android.sourceSets.main.java.srcDirs
|
||||
classifier = 'sources'
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven'
|
||||
sourceCompatibility = JavaVersion.VERSION_1_6
|
||||
targetCompatibility = JavaVersion.VERSION_1_6
|
||||
|
||||
install {
|
||||
repositories.mavenInstaller {
|
||||
pom.artifactId = 'petstore-jersey2-java6'
|
||||
}
|
||||
}
|
||||
|
||||
task execute(type:JavaExec) {
|
||||
main = System.getProperty('mainClass')
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.5.20"
|
||||
jackson_version = "2.9.6"
|
||||
jersey_version = "2.6"
|
||||
commons_io_version=2.5
|
||||
commons_lang3_version=3.6
|
||||
junit_version = "4.13"
|
||||
threetenbp_version = "2.6.4"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||
compile "org.glassfish.jersey.core:jersey-client:$jersey_version"
|
||||
compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version"
|
||||
compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version"
|
||||
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
|
||||
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||||
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
|
||||
compile "commons-io:commons-io:$commons_io_version"
|
||||
compile "org.apache.commons:commons-lang3:$commons_lang3_version"
|
||||
compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version"
|
||||
compile "com.brsanthu:migbase64:2.2"
|
||||
testCompile "junit:junit:$junit_version"
|
||||
}
|
||||
@@ -0,0 +1,291 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import org.openapitools.client.auth.*;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class ApiClientTest {
|
||||
ApiClient apiClient = null;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
apiClient = new ApiClient();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseAndFormatDate() {
|
||||
// default date format
|
||||
String dateStr = "2015-11-07T03:49:09.356Z";
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00")));
|
||||
|
||||
// custom date format: without milli-seconds, custom time zone
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT);
|
||||
format.setTimeZone(TimeZone.getTimeZone("GMT+10"));
|
||||
apiClient.setDateFormat(format);
|
||||
dateStr = "2015-11-07T13:49:09+10:00";
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsJsonMime() {
|
||||
assertFalse(apiClient.isJsonMime(null));
|
||||
assertFalse(apiClient.isJsonMime(""));
|
||||
assertFalse(apiClient.isJsonMime("text/plain"));
|
||||
assertFalse(apiClient.isJsonMime("application/xml"));
|
||||
assertFalse(apiClient.isJsonMime("application/jsonp"));
|
||||
assertFalse(apiClient.isJsonMime("example/json"));
|
||||
assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx"));
|
||||
assertFalse(apiClient.isJsonMime("example/foo+bar+xjson"));
|
||||
|
||||
assertTrue(apiClient.isJsonMime("application/json"));
|
||||
assertTrue(apiClient.isJsonMime("application/json; charset=UTF8"));
|
||||
assertTrue(apiClient.isJsonMime("APPLICATION/JSON"));
|
||||
|
||||
assertTrue(apiClient.isJsonMime("application/problem+json"));
|
||||
assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON"));
|
||||
assertTrue(apiClient.isJsonMime("application/json\t"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+bar+json"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+json;x;y"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+json\t;"));
|
||||
assertTrue(apiClient.isJsonMime("Example/fOO+JSON"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectHeaderAccept() {
|
||||
String[] accepts = {"application/json", "application/xml"};
|
||||
assertEquals("application/json", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"};
|
||||
assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"application/xml", "application/json; charset=UTF8"};
|
||||
assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"text/plain", "application/xml"};
|
||||
assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{};
|
||||
assertNull(apiClient.selectHeaderAccept(accepts));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectHeaderContentType() {
|
||||
String[] contentTypes = {"application/json", "application/xml"};
|
||||
assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"};
|
||||
assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"};
|
||||
assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"text/plain", "application/xml"};
|
||||
assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{};
|
||||
assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAuthentications() {
|
||||
Map<String, Authentication> auths = apiClient.getAuthentications();
|
||||
|
||||
Authentication auth = auths.get("api_key");
|
||||
assertNotNull(auth);
|
||||
assertTrue(auth instanceof ApiKeyAuth);
|
||||
ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth;
|
||||
assertEquals("header", apiKeyAuth.getLocation());
|
||||
assertEquals("api_key", apiKeyAuth.getParamName());
|
||||
|
||||
auth = auths.get("petstore_auth");
|
||||
assertTrue(auth instanceof OAuth);
|
||||
assertSame(auth, apiClient.getAuthentication("petstore_auth"));
|
||||
|
||||
assertNull(auths.get("unknown"));
|
||||
|
||||
try {
|
||||
auths.put("my_auth", new HttpBasicAuth());
|
||||
fail("the authentications returned should not be modifiable");
|
||||
} catch (UnsupportedOperationException e) {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetUsernameAndPassword() {
|
||||
HttpBasicAuth auth = null;
|
||||
for (Authentication _auth : apiClient.getAuthentications().values()) {
|
||||
if (_auth instanceof HttpBasicAuth) {
|
||||
auth = (HttpBasicAuth) _auth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
|
||||
apiClient.setUsername("my-username");
|
||||
apiClient.setPassword("my-password");
|
||||
assertEquals("my-username", auth.getUsername());
|
||||
assertEquals("my-password", auth.getPassword());
|
||||
|
||||
// reset values
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetApiKeyAndPrefix() {
|
||||
ApiKeyAuth auth = null;
|
||||
for (Authentication _auth : apiClient.getAuthentications().values()) {
|
||||
if (_auth instanceof ApiKeyAuth) {
|
||||
auth = (ApiKeyAuth) _auth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
auth.setApiKey(null);
|
||||
auth.setApiKeyPrefix(null);
|
||||
|
||||
apiClient.setApiKey("my-api-key");
|
||||
apiClient.setApiKeyPrefix("Token");
|
||||
assertEquals("my-api-key", auth.getApiKey());
|
||||
assertEquals("Token", auth.getApiKeyPrefix());
|
||||
|
||||
// reset values
|
||||
auth.setApiKey(null);
|
||||
auth.setApiKeyPrefix(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairWhenNameIsInvalid() throws Exception {
|
||||
List<Pair> pairs_a = apiClient.parameterToPair(null, new Integer(1));
|
||||
List<Pair> pairs_b = apiClient.parameterToPair("", new Integer(1));
|
||||
|
||||
assertTrue(pairs_a.isEmpty());
|
||||
assertTrue(pairs_b.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairWhenValueIsNull() throws Exception {
|
||||
List<Pair> pairs = apiClient.parameterToPair("param-a", null);
|
||||
|
||||
assertTrue(pairs.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairWhenValueIsEmptyString() throws Exception {
|
||||
// single empty string
|
||||
List<Pair> pairs = apiClient.parameterToPair("param-a", " ");
|
||||
assertEquals(1, pairs.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairWhenValueIsNotCollection() throws Exception {
|
||||
String name = "param-a";
|
||||
Integer value = 1;
|
||||
|
||||
List<Pair> pairs = apiClient.parameterToPair(name, value);
|
||||
|
||||
assertEquals(1, pairs.size());
|
||||
assertEquals(value, Integer.valueOf(pairs.get(0).getValue()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairWhenValueIsCollection() throws Exception {
|
||||
List<Object> values = new ArrayList<Object>();
|
||||
values.add("value-a");
|
||||
values.add(123);
|
||||
values.add(new Date());
|
||||
|
||||
List<Pair> pairs = apiClient.parameterToPair("param-a", values);
|
||||
assertEquals(0, pairs.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenNameIsInvalid() throws Exception {
|
||||
List<Integer> objects = new ArrayList<Integer>();
|
||||
objects.add(new Integer(1));
|
||||
|
||||
List<Pair> pairs_a = apiClient.parameterToPairs("csv", null, objects);
|
||||
List<Pair> pairs_b = apiClient.parameterToPairs("csv", "", objects);
|
||||
|
||||
assertTrue(pairs_a.isEmpty());
|
||||
assertTrue(pairs_b.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenValueIsNull() throws Exception {
|
||||
List<Pair> pairs = apiClient.parameterToPairs("csv", "param-a", null);
|
||||
|
||||
assertTrue(pairs.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception {
|
||||
// list of empty strings
|
||||
List<String> strs = new ArrayList<String>();
|
||||
strs.add(" ");
|
||||
strs.add(" ");
|
||||
strs.add(" ");
|
||||
|
||||
List<Pair> concatStrings = apiClient.parameterToPairs("csv", "param-a", strs);
|
||||
|
||||
assertEquals(1, concatStrings.size());
|
||||
assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenValueIsCollection() throws Exception {
|
||||
Map<String, String> collectionFormatMap = new HashMap<String, String>();
|
||||
collectionFormatMap.put("csv", ",");
|
||||
collectionFormatMap.put("tsv", "\t");
|
||||
collectionFormatMap.put("ssv", " ");
|
||||
collectionFormatMap.put("pipes", "|");
|
||||
collectionFormatMap.put("", ","); // no format, must default to csv
|
||||
collectionFormatMap.put("unknown", ","); // all other formats, must default to csv
|
||||
|
||||
String name = "param-a";
|
||||
|
||||
List<Object> values = new ArrayList<Object>();
|
||||
values.add("value-a");
|
||||
values.add(123);
|
||||
values.add(new Date());
|
||||
|
||||
// check for multi separately
|
||||
List<Pair> multiPairs = apiClient.parameterToPairs("multi", name, values);
|
||||
assertEquals(values.size(), multiPairs.size());
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue());
|
||||
}
|
||||
|
||||
// all other formats
|
||||
for (String collectionFormat : collectionFormatMap.keySet()) {
|
||||
List<Pair> pairs = apiClient.parameterToPairs(collectionFormat, name, values);
|
||||
|
||||
assertEquals(1, pairs.size());
|
||||
|
||||
String delimiter = collectionFormatMap.get(collectionFormat);
|
||||
if (!delimiter.equals(",")) {
|
||||
// commas are not escaped because they are reserved characters in URIs
|
||||
delimiter = apiClient.escapeString(delimiter);
|
||||
}
|
||||
String[] pairValueSplit = pairs.get(0).getValue().split(delimiter);
|
||||
|
||||
// must equal input values
|
||||
assertEquals(values.size(), pairValueSplit.length);
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import org.openapitools.client.Pair;
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class ApiKeyAuthTest {
|
||||
@Test
|
||||
public void testApplyToParamsInQuery() {
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> cookieParams = new HashMap<String, String>();
|
||||
|
||||
ApiKeyAuth auth = new ApiKeyAuth("query", "api_key");
|
||||
auth.setApiKey("my-api-key");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
|
||||
assertEquals(1, queryParams.size());
|
||||
for (Pair queryParam : queryParams) {
|
||||
assertEquals("my-api-key", queryParam.getValue());
|
||||
}
|
||||
|
||||
// no changes to header or cookie parameters
|
||||
assertEquals(0, headerParams.size());
|
||||
assertEquals(0, cookieParams.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyToParamsInHeaderWithPrefix() {
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> cookieParams = new HashMap<String, String>();
|
||||
|
||||
ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN");
|
||||
auth.setApiKey("my-api-token");
|
||||
auth.setApiKeyPrefix("Token");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
|
||||
// no changes to query or cookie parameters
|
||||
assertEquals(0, queryParams.size());
|
||||
assertEquals(0, cookieParams.size());
|
||||
|
||||
assertEquals(1, headerParams.size());
|
||||
assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyToParamsInCookieWithPrefix() {
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> cookieParams = new HashMap<String, String>();
|
||||
|
||||
ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN");
|
||||
auth.setApiKey("my-api-token");
|
||||
auth.setApiKeyPrefix("Token");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
|
||||
// no changes to query or header parameters
|
||||
assertEquals(0, queryParams.size());
|
||||
assertEquals(0, headerParams.size());
|
||||
|
||||
assertEquals(1, cookieParams.size());
|
||||
assertEquals("Token my-api-token", cookieParams.get("X-API-TOKEN"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import org.openapitools.client.Pair;
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class HttpBasicAuthTest {
|
||||
HttpBasicAuth auth = null;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
auth = new HttpBasicAuth();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyToParams() {
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> cookieParams = new HashMap<String, String>();
|
||||
|
||||
auth.setUsername("my-username");
|
||||
auth.setPassword("my-password");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
|
||||
// no changes to query or cookie parameters
|
||||
assertEquals(0, queryParams.size());
|
||||
assertEquals(0, cookieParams.size());
|
||||
assertEquals(1, headerParams.size());
|
||||
// the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix
|
||||
String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ=";
|
||||
assertEquals(expected, headerParams.get("Authorization"));
|
||||
|
||||
// null username should be treated as empty string
|
||||
auth.setUsername(null);
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
// the string below is base64-encoded result of ":my-password" with the "Basic " prefix
|
||||
expected = "Basic Om15LXBhc3N3b3Jk";
|
||||
assertEquals(expected, headerParams.get("Authorization"));
|
||||
|
||||
// null password should be treated as empty string
|
||||
auth.setUsername("my-username");
|
||||
auth.setPassword(null);
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
// the string below is base64-encoded result of "my-username:" with the "Basic " prefix
|
||||
expected = "Basic bXktdXNlcm5hbWU6";
|
||||
assertEquals(expected, headerParams.get("Authorization"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ObjectWriter;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
public class EnumValueTest {
|
||||
|
||||
@Test
|
||||
public void testEnumClass() {
|
||||
assertEquals(EnumClass._ABC.toString(), "_abc");
|
||||
assertEquals(EnumClass._EFG.toString(), "-efg");
|
||||
assertEquals(EnumClass._XYZ_.toString(), "(xyz)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEnumTest() {
|
||||
// test enum value
|
||||
EnumTest enumTest = new EnumTest();
|
||||
enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER);
|
||||
enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1);
|
||||
enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1);
|
||||
|
||||
assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER");
|
||||
assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER");
|
||||
assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower");
|
||||
assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower");
|
||||
|
||||
assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1");
|
||||
assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1);
|
||||
assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1");
|
||||
assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1);
|
||||
|
||||
assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1");
|
||||
assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1);
|
||||
assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2");
|
||||
assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2);
|
||||
|
||||
try {
|
||||
// test serialization (object => json)
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
|
||||
ObjectWriter ow = mapper.writer();
|
||||
String json = ow.writeValueAsString(enumTest);
|
||||
assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}");
|
||||
|
||||
// test deserialization (json => object)
|
||||
EnumTest fromString = mapper.readValue(json, EnumTest.class);
|
||||
assertEquals(fromString.getEnumString().toString(), "lower");
|
||||
assertEquals(fromString.getEnumInteger().toString(), "1");
|
||||
assertEquals(fromString.getEnumNumber().toString(), "1.1");
|
||||
|
||||
} catch (Exception e) {
|
||||
fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import org.openapitools.client.model.Mammal;
|
||||
import org.openapitools.client.model.AppleReq;
|
||||
import org.openapitools.client.model.BananaReq;
|
||||
import org.openapitools.client.model.FruitReq;
|
||||
import org.openapitools.client.model.BasquePig;
|
||||
import org.openapitools.client.model.Pig;
|
||||
import org.openapitools.client.model.Whale;
|
||||
import org.openapitools.client.model.Zebra;
|
||||
import java.lang.Exception;
|
||||
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class JSONComposedSchemaTest {
|
||||
JSON json = null;
|
||||
Mammal mammal = null;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
json = new JSON();
|
||||
mammal = new Mammal();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a oneOf schema can be deserialized into the expected class.
|
||||
* The oneOf schema does not have a discriminator.
|
||||
*/
|
||||
@Test
|
||||
public void testOneOfSchemaWithoutDiscriminator() throws Exception {
|
||||
// BananaReq and AppleReq have explicitly defined properties that are different by name.
|
||||
// There is no discriminator property.
|
||||
String str = "{ \"cultivar\": \"golden delicious\", \"mealy\": false }";
|
||||
FruitReq o = json.getContext(null).readValue(str, FruitReq.class);
|
||||
assertTrue(o.getActualInstance() instanceof AppleReq);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a oneOf schema can be deserialized into the expected class.
|
||||
* The oneOf schema has a discriminator.
|
||||
*/
|
||||
@Test
|
||||
public void testOneOfSchemaWithDiscriminator() throws Exception {
|
||||
// Mammal can be one of whale, pig and zebra.
|
||||
// pig has sub-classes.
|
||||
String str = "{ \"className\": \"whale\", \"hasBaleen\": true, \"hasTeeth\": false }";
|
||||
/*
|
||||
DISABLING unit test for now until ambiguity of discriminator is resolved.
|
||||
|
||||
// Note that the 'zebra' schema does not have any explicit property defined AND
|
||||
// it has additionalProperties: true. Hence without a discriminator the above
|
||||
// JSON payload would match both 'whale' and 'zebra'. This is because the 'hasBaleen'
|
||||
// and 'hasTeeth' would be considered additional (undeclared) properties for 'zebra'.
|
||||
Mammal o = json.getContext(null).readValue(str, Mammal.class);
|
||||
assertTrue(o.getActualInstance() instanceof Whale);
|
||||
|
||||
str = "{ \"className\": \"zebra\" }";
|
||||
o = json.getContext(null).readValue(str, Mammal.class);
|
||||
assertTrue(o.getActualInstance() instanceof Zebra);
|
||||
|
||||
str = "{ \"className\": \"BasquePig\" }";
|
||||
o = json.getContext(null).readValue(str, Mammal.class);
|
||||
assertTrue(o.getActualInstance() instanceof BasquePig);
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import org.openapitools.client.model.Order;
|
||||
|
||||
import java.lang.Exception;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class JSONTest {
|
||||
JSON json = null;
|
||||
Order order = null;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
json = new JSON();
|
||||
order = new Order();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultDate() throws Exception {
|
||||
final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
||||
final String dateStr = "2015-11-07T14:11:05.267Z";
|
||||
order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from));
|
||||
|
||||
String str = json.getContext(null).writeValueAsString(order);
|
||||
Order o = json.getContext(null).readValue(str, Order.class);
|
||||
assertEquals(dateStr, dateFormat.format(o.getShipDate()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCustomDate() throws Exception {
|
||||
final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2"));
|
||||
final String dateStr = "2015-11-07T14:11:05-02:00";
|
||||
order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime::from));
|
||||
|
||||
String str = json.getContext(null).writeValueAsString(order);
|
||||
Order o = json.getContext(null).readValue(str, Order.class);
|
||||
assertEquals(dateStr, dateFormat.format(o.getShipDate()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,249 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import org.openapitools.client.auth.*;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class ApiClientTest {
|
||||
ApiClient apiClient = null;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
apiClient = new ApiClient();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseAndFormatDate() {
|
||||
// default date format
|
||||
String dateStr = "2015-11-07T03:49:09.356Z";
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00")));
|
||||
|
||||
// custom date format: without milli-seconds, custom time zone
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT);
|
||||
format.setTimeZone(TimeZone.getTimeZone("GMT+10"));
|
||||
apiClient.setDateFormat(format);
|
||||
dateStr = "2015-11-07T13:49:09+10:00";
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsJsonMime() {
|
||||
assertFalse(apiClient.isJsonMime(null));
|
||||
assertFalse(apiClient.isJsonMime(""));
|
||||
assertFalse(apiClient.isJsonMime("text/plain"));
|
||||
assertFalse(apiClient.isJsonMime("application/xml"));
|
||||
assertFalse(apiClient.isJsonMime("application/jsonp"));
|
||||
assertFalse(apiClient.isJsonMime("example/json"));
|
||||
assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx"));
|
||||
assertFalse(apiClient.isJsonMime("example/foo+bar+xjson"));
|
||||
|
||||
assertTrue(apiClient.isJsonMime("application/json"));
|
||||
assertTrue(apiClient.isJsonMime("application/json; charset=UTF8"));
|
||||
assertTrue(apiClient.isJsonMime("APPLICATION/JSON"));
|
||||
|
||||
assertTrue(apiClient.isJsonMime("application/problem+json"));
|
||||
assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON"));
|
||||
assertTrue(apiClient.isJsonMime("application/json\t"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+bar+json"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+json;x;y"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+json\t;"));
|
||||
assertTrue(apiClient.isJsonMime("Example/fOO+JSON"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectHeaderAccept() {
|
||||
String[] accepts = {"application/json", "application/xml"};
|
||||
assertEquals("application/json", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"};
|
||||
assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"application/xml", "application/json; charset=UTF8"};
|
||||
assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"text/plain", "application/xml"};
|
||||
assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{};
|
||||
assertNull(apiClient.selectHeaderAccept(accepts));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectHeaderContentType() {
|
||||
String[] contentTypes = {"application/json", "application/xml"};
|
||||
assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"};
|
||||
assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"};
|
||||
assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"text/plain", "application/xml"};
|
||||
assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{};
|
||||
assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAuthentications() {
|
||||
Map<String, Authentication> auths = apiClient.getAuthentications();
|
||||
|
||||
Authentication auth = auths.get("api_key");
|
||||
assertNotNull(auth);
|
||||
assertTrue(auth instanceof ApiKeyAuth);
|
||||
ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth;
|
||||
assertEquals("header", apiKeyAuth.getLocation());
|
||||
assertEquals("api_key", apiKeyAuth.getParamName());
|
||||
|
||||
auth = auths.get("petstore_auth");
|
||||
assertTrue(auth instanceof OAuth);
|
||||
assertSame(auth, apiClient.getAuthentication("petstore_auth"));
|
||||
|
||||
assertNull(auths.get("unknown"));
|
||||
|
||||
try {
|
||||
auths.put("my_auth", new HttpBasicAuth());
|
||||
fail("the authentications returned should not be modifiable");
|
||||
} catch (UnsupportedOperationException e) {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetUsernameAndPassword() {
|
||||
HttpBasicAuth auth = null;
|
||||
for (Authentication _auth : apiClient.getAuthentications().values()) {
|
||||
if (_auth instanceof HttpBasicAuth) {
|
||||
auth = (HttpBasicAuth) _auth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
|
||||
apiClient.setUsername("my-username");
|
||||
apiClient.setPassword("my-password");
|
||||
assertEquals("my-username", auth.getUsername());
|
||||
assertEquals("my-password", auth.getPassword());
|
||||
|
||||
// reset values
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetApiKeyAndPrefix() {
|
||||
ApiKeyAuth auth = null;
|
||||
for (Authentication _auth : apiClient.getAuthentications().values()) {
|
||||
if (_auth instanceof ApiKeyAuth) {
|
||||
auth = (ApiKeyAuth) _auth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
auth.setApiKey(null);
|
||||
auth.setApiKeyPrefix(null);
|
||||
|
||||
apiClient.setApiKey("my-api-key");
|
||||
apiClient.setApiKeyPrefix("Token");
|
||||
assertEquals("my-api-key", auth.getApiKey());
|
||||
assertEquals("Token", auth.getApiKeyPrefix());
|
||||
|
||||
// reset values
|
||||
auth.setApiKey(null);
|
||||
auth.setApiKeyPrefix(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenNameIsInvalid() throws Exception {
|
||||
List<Pair> pairs_a = apiClient.parameterToPairs("csv", null, new Integer(1));
|
||||
List<Pair> pairs_b = apiClient.parameterToPairs("csv", "", new Integer(1));
|
||||
|
||||
assertTrue(pairs_a.isEmpty());
|
||||
assertTrue(pairs_b.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenValueIsNull() throws Exception {
|
||||
List<Pair> pairs = apiClient.parameterToPairs("csv", "param-a", null);
|
||||
|
||||
assertTrue(pairs.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception {
|
||||
|
||||
// single empty string
|
||||
List<Pair> pairs = apiClient.parameterToPairs("csv", "param-a", " ");
|
||||
assertEquals(1, pairs.size());
|
||||
|
||||
// list of empty strings
|
||||
List<String> strs = new ArrayList<String>();
|
||||
strs.add(" ");
|
||||
strs.add(" ");
|
||||
strs.add(" ");
|
||||
|
||||
List<Pair> concatStrings = apiClient.parameterToPairs("csv", "param-a", strs);
|
||||
|
||||
assertEquals(1, concatStrings.size());
|
||||
assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenValueIsNotCollection() throws Exception {
|
||||
String name = "param-a";
|
||||
Integer value = 1;
|
||||
|
||||
List<Pair> pairs = apiClient.parameterToPairs("csv", name, value);
|
||||
|
||||
assertEquals(1, pairs.size());
|
||||
assertEquals(value, Integer.valueOf(pairs.get(0).getValue()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenValueIsCollection() throws Exception {
|
||||
Map<String, String> collectionFormatMap = new HashMap<String, String>();
|
||||
collectionFormatMap.put("csv", ",");
|
||||
collectionFormatMap.put("tsv", "\t");
|
||||
collectionFormatMap.put("ssv", " ");
|
||||
collectionFormatMap.put("pipes", "\\|");
|
||||
collectionFormatMap.put("", ","); // no format, must default to csv
|
||||
collectionFormatMap.put("unknown", ","); // all other formats, must default to csv
|
||||
|
||||
String name = "param-a";
|
||||
|
||||
List<Object> values = new ArrayList<Object>();
|
||||
values.add("value-a");
|
||||
values.add(123);
|
||||
values.add(new Date());
|
||||
|
||||
// check for multi separately
|
||||
List<Pair> multiPairs = apiClient.parameterToPairs("multi", name, values);
|
||||
assertEquals(values.size(), multiPairs.size());
|
||||
|
||||
// all other formats
|
||||
for (String collectionFormat : collectionFormatMap.keySet()) {
|
||||
List<Pair> pairs = apiClient.parameterToPairs(collectionFormat, name, values);
|
||||
|
||||
assertEquals(1, pairs.size());
|
||||
|
||||
String delimiter = collectionFormatMap.get(collectionFormat);
|
||||
String[] pairValueSplit = pairs.get(0).getValue().split(delimiter);
|
||||
|
||||
// must equal input values
|
||||
assertEquals(values.size(), pairValueSplit.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import org.openapitools.client.model.Order;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.threeten.bp.OffsetDateTime;
|
||||
import org.threeten.bp.ZoneId;
|
||||
import org.threeten.bp.format.DateTimeFormatter;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class JSONTest {
|
||||
private JSON json = null;
|
||||
private Order order = null;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
json = new ApiClient().getJSON();
|
||||
order = new Order();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDefaultDate() throws Exception {
|
||||
final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
||||
final String dateStr = "2015-11-07T14:11:05.267Z";
|
||||
order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime.FROM));
|
||||
|
||||
String str = json.getContext(null).writeValueAsString(order);
|
||||
Order o = json.getContext(null).readValue(str, Order.class);
|
||||
assertEquals(dateStr, dateFormat.format(o.getShipDate()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCustomDate() throws Exception {
|
||||
final DateTimeFormatter dateFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2"));
|
||||
final String dateStr = "2015-11-07T14:11:05-02:00";
|
||||
order.setShipDate(dateFormat.parse(dateStr, OffsetDateTime.FROM));
|
||||
|
||||
String str = json.getContext(null).writeValueAsString(order);
|
||||
Order o = json.getContext(null).readValue(str, Order.class);
|
||||
assertEquals(dateStr, dateFormat.format(o.getShipDate()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSqlDateSerialization() throws Exception {
|
||||
String str = json.getContext(null).writeValueAsString(new java.sql.Date(10));
|
||||
assertEquals("\"1970-01-01\"", str);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSqlDateDeserialization() throws Exception {
|
||||
final String str = "1970-01-01";
|
||||
java.sql.Date date = json.getContext(null).readValue("\"" + str + "\"", java.sql.Date.class);
|
||||
assertEquals(date.toString(), str);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Pair;
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class ApiKeyAuthTest {
|
||||
@Test
|
||||
public void testApplyToParamsInQuery() throws ApiException {
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> cookieParams = new HashMap<String, String>();
|
||||
|
||||
ApiKeyAuth auth = new ApiKeyAuth("query", "api_key");
|
||||
auth.setApiKey("my-api-key");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null);
|
||||
|
||||
assertEquals(1, queryParams.size());
|
||||
for (Pair queryParam : queryParams) {
|
||||
assertEquals("my-api-key", queryParam.getValue());
|
||||
}
|
||||
|
||||
// no changes to header or cookie parameters
|
||||
assertEquals(0, headerParams.size());
|
||||
assertEquals(0, cookieParams.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyToParamsInHeaderWithPrefix() throws ApiException {
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> cookieParams = new HashMap<String, String>();
|
||||
|
||||
ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN");
|
||||
auth.setApiKey("my-api-token");
|
||||
auth.setApiKeyPrefix("Token");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null);
|
||||
|
||||
// no changes to query parameters
|
||||
assertEquals(0, queryParams.size());
|
||||
assertEquals(0, cookieParams.size());
|
||||
assertEquals(1, headerParams.size());
|
||||
assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyToParamsInCookieWithPrefix() throws ApiException {
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> cookieParams = new HashMap<String, String>();
|
||||
|
||||
ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN");
|
||||
auth.setApiKey("my-api-token");
|
||||
auth.setApiKeyPrefix("Token");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null);
|
||||
|
||||
// no changes to query or header parameters
|
||||
assertEquals(0, queryParams.size());
|
||||
assertEquals(0, headerParams.size());
|
||||
assertEquals(1, cookieParams.size());
|
||||
assertEquals("Token my-api-token", cookieParams.get("X-API-TOKEN"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import org.openapitools.client.ApiException;
|
||||
import org.openapitools.client.Pair;
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class HttpBasicAuthTest {
|
||||
HttpBasicAuth auth = null;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
auth = new HttpBasicAuth();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyToParams() throws ApiException {
|
||||
List<Pair> queryParams = new ArrayList<Pair>();
|
||||
Map<String, String> headerParams = new HashMap<String, String>();
|
||||
Map<String, String> cookieParams = new HashMap<String, String>();
|
||||
|
||||
auth.setUsername("my-username");
|
||||
auth.setPassword("my-password");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null);
|
||||
|
||||
// no changes to query parameters
|
||||
assertEquals(0, queryParams.size());
|
||||
assertEquals(1, headerParams.size());
|
||||
// the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix
|
||||
String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ=";
|
||||
assertEquals(expected, headerParams.get("Authorization"));
|
||||
|
||||
// null username should be treated as empty string
|
||||
auth.setUsername(null);
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null);
|
||||
// the string below is base64-encoded result of ":my-password" with the "Basic " prefix
|
||||
expected = "Basic Om15LXBhc3N3b3Jk";
|
||||
assertEquals(expected, headerParams.get("Authorization"));
|
||||
|
||||
// null password should be treated as empty string
|
||||
auth.setUsername("my-username");
|
||||
auth.setPassword(null);
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams, null, null, null);
|
||||
// the string below is base64-encoded result of "my-username:" with the "Basic " prefix
|
||||
expected = "Basic bXktdXNlcm5hbWU6";
|
||||
assertEquals(expected, headerParams.get("Authorization"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ObjectWriter;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
public class EnumValueTest {
|
||||
|
||||
@Test
|
||||
public void testEnumClass() {
|
||||
assertEquals(EnumClass._ABC.toString(), "_abc");
|
||||
assertEquals(EnumClass._EFG.toString(), "-efg");
|
||||
assertEquals(EnumClass._XYZ_.toString(), "(xyz)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEnumTest() {
|
||||
// test enum value
|
||||
EnumTest enumTest = new EnumTest();
|
||||
enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER);
|
||||
enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1);
|
||||
enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1);
|
||||
|
||||
assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER");
|
||||
assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER");
|
||||
assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower");
|
||||
assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower");
|
||||
|
||||
assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1");
|
||||
assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1);
|
||||
assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1");
|
||||
assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1);
|
||||
|
||||
assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1");
|
||||
assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1);
|
||||
assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2");
|
||||
assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2);
|
||||
|
||||
try {
|
||||
// test serialization (object => json)
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
|
||||
ObjectWriter ow = mapper.writer();
|
||||
String json = ow.writeValueAsString(enumTest);
|
||||
assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}");
|
||||
|
||||
// test deserialization (json => object)
|
||||
EnumTest fromString = mapper.readValue(json, EnumTest.class);
|
||||
assertEquals(fromString.getEnumString().toString(), "lower");
|
||||
assertEquals(fromString.getEnumInteger().toString(), "1");
|
||||
assertEquals(fromString.getEnumNumber().toString(), "1.1");
|
||||
|
||||
} catch (Exception e) {
|
||||
fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,347 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import okhttp3.OkHttpClient;
|
||||
import org.openapitools.client.auth.*;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.junit.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
|
||||
|
||||
public class ApiClientTest {
|
||||
ApiClient apiClient;
|
||||
JSON json;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
apiClient = new ApiClient();
|
||||
json = apiClient.getJSON();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsJsonMime() {
|
||||
assertFalse(apiClient.isJsonMime(null));
|
||||
assertFalse(apiClient.isJsonMime(""));
|
||||
assertFalse(apiClient.isJsonMime("text/plain"));
|
||||
assertFalse(apiClient.isJsonMime("application/xml"));
|
||||
assertFalse(apiClient.isJsonMime("application/jsonp"));
|
||||
assertFalse(apiClient.isJsonMime("example/json"));
|
||||
assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx"));
|
||||
assertFalse(apiClient.isJsonMime("example/foo+bar+xjson"));
|
||||
|
||||
assertTrue(apiClient.isJsonMime("application/json"));
|
||||
assertTrue(apiClient.isJsonMime("application/json; charset=UTF8"));
|
||||
assertTrue(apiClient.isJsonMime("APPLICATION/JSON"));
|
||||
|
||||
assertTrue(apiClient.isJsonMime("application/problem+json"));
|
||||
assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON"));
|
||||
assertTrue(apiClient.isJsonMime("application/json\t"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+bar+json"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+json;x;y"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+json\t;"));
|
||||
assertTrue(apiClient.isJsonMime("Example/fOO+JSON"));
|
||||
|
||||
assertTrue(apiClient.isJsonMime("application/json-patch+json"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectHeaderAccept() {
|
||||
String[] accepts = {"application/json", "application/xml"};
|
||||
assertEquals("application/json", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"};
|
||||
assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"application/xml", "application/json; charset=UTF8"};
|
||||
assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"text/plain", "application/xml"};
|
||||
assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{};
|
||||
assertNull(apiClient.selectHeaderAccept(accepts));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectHeaderContentType() {
|
||||
String[] contentTypes = {"application/json", "application/xml"};
|
||||
assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"};
|
||||
assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"};
|
||||
assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"text/plain", "application/xml"};
|
||||
assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{};
|
||||
assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAuthentications() {
|
||||
Map<String, Authentication> auths = apiClient.getAuthentications();
|
||||
|
||||
Authentication auth = auths.get("api_key");
|
||||
assertNotNull(auth);
|
||||
assertTrue(auth instanceof ApiKeyAuth);
|
||||
ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth;
|
||||
assertEquals("header", apiKeyAuth.getLocation());
|
||||
assertEquals("api_key", apiKeyAuth.getParamName());
|
||||
|
||||
auth = auths.get("petstore_auth");
|
||||
assertTrue(auth instanceof OAuth);
|
||||
assertSame(auth, apiClient.getAuthentication("petstore_auth"));
|
||||
|
||||
assertNull(auths.get("unknown"));
|
||||
|
||||
try {
|
||||
auths.put("my_auth", new HttpBasicAuth());
|
||||
fail("the authentications returned should not be modifiable");
|
||||
} catch (UnsupportedOperationException e) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@Test
|
||||
public void testSetUsernameAndPassword() {
|
||||
HttpBasicAuth auth = null;
|
||||
for (Authentication _auth : apiClient.getAuthentications().values()) {
|
||||
if (_auth instanceof HttpBasicAuth) {
|
||||
auth = (HttpBasicAuth) _auth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
|
||||
apiClient.setUsername("my-username");
|
||||
apiClient.setPassword("my-password");
|
||||
assertEquals("my-username", auth.getUsername());
|
||||
assertEquals("my-password", auth.getPassword());
|
||||
|
||||
// reset values
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
}
|
||||
*/
|
||||
|
||||
@Test
|
||||
public void testSetApiKeyAndPrefix() {
|
||||
ApiKeyAuth auth = null;
|
||||
for (Authentication _auth : apiClient.getAuthentications().values()) {
|
||||
if (_auth instanceof ApiKeyAuth) {
|
||||
auth = (ApiKeyAuth) _auth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
auth.setApiKey(null);
|
||||
auth.setApiKeyPrefix(null);
|
||||
|
||||
apiClient.setApiKey("my-api-key");
|
||||
apiClient.setApiKeyPrefix("Token");
|
||||
assertEquals("my-api-key", auth.getApiKey());
|
||||
assertEquals("Token", auth.getApiKeyPrefix());
|
||||
|
||||
// reset values
|
||||
auth.setApiKey(null);
|
||||
auth.setApiKeyPrefix(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAndSetConnectTimeout() {
|
||||
// connect timeout defaults to 10 seconds
|
||||
assertEquals(10000, apiClient.getConnectTimeout());
|
||||
assertEquals(10000, apiClient.getHttpClient().connectTimeoutMillis());
|
||||
|
||||
apiClient.setConnectTimeout(0);
|
||||
assertEquals(0, apiClient.getConnectTimeout());
|
||||
assertEquals(0, apiClient.getHttpClient().connectTimeoutMillis());
|
||||
|
||||
apiClient.setConnectTimeout(10000);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAndSetReadTimeout() {
|
||||
// read timeout defaults to 10 seconds
|
||||
assertEquals(10000, apiClient.getReadTimeout());
|
||||
assertEquals(10000, apiClient.getHttpClient().readTimeoutMillis());
|
||||
|
||||
apiClient.setReadTimeout(0);
|
||||
assertEquals(0, apiClient.getReadTimeout());
|
||||
assertEquals(0, apiClient.getHttpClient().readTimeoutMillis());
|
||||
|
||||
apiClient.setReadTimeout(10000);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAndSetWriteTimeout() {
|
||||
// write timeout defaults to 10 seconds
|
||||
assertEquals(10000, apiClient.getWriteTimeout());
|
||||
assertEquals(10000, apiClient.getHttpClient().writeTimeoutMillis());
|
||||
|
||||
apiClient.setWriteTimeout(0);
|
||||
assertEquals(0, apiClient.getWriteTimeout());
|
||||
assertEquals(0, apiClient.getHttpClient().writeTimeoutMillis());
|
||||
|
||||
apiClient.setWriteTimeout(10000);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairWhenNameIsInvalid() throws Exception {
|
||||
List<Pair> pairs_a = apiClient.parameterToPair(null, new Integer(1));
|
||||
List<Pair> pairs_b = apiClient.parameterToPair("", new Integer(1));
|
||||
|
||||
assertTrue(pairs_a.isEmpty());
|
||||
assertTrue(pairs_b.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairWhenValueIsNull() throws Exception {
|
||||
List<Pair> pairs = apiClient.parameterToPair("param-a", null);
|
||||
|
||||
assertTrue(pairs.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairWhenValueIsEmptyString() throws Exception {
|
||||
// single empty string
|
||||
List<Pair> pairs = apiClient.parameterToPair("param-a", " ");
|
||||
assertEquals(1, pairs.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairWhenValueIsNotCollection() throws Exception {
|
||||
String name = "param-a";
|
||||
Integer value = 1;
|
||||
|
||||
List<Pair> pairs = apiClient.parameterToPair(name, value);
|
||||
|
||||
assertEquals(1, pairs.size());
|
||||
assertEquals(value, Integer.valueOf(pairs.get(0).getValue()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairWhenValueIsCollection() throws Exception {
|
||||
List<Object> values = new ArrayList<Object>();
|
||||
values.add("value-a");
|
||||
values.add(123);
|
||||
values.add(new Date());
|
||||
|
||||
List<Pair> pairs = apiClient.parameterToPair("param-a", values);
|
||||
assertEquals(0, pairs.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenNameIsInvalid() throws Exception {
|
||||
List<Integer> objects = new ArrayList<Integer>();
|
||||
objects.add(new Integer(1));
|
||||
|
||||
List<Pair> pairs_a = apiClient.parameterToPairs("csv", null, objects);
|
||||
List<Pair> pairs_b = apiClient.parameterToPairs("csv", "", objects);
|
||||
|
||||
assertTrue(pairs_a.isEmpty());
|
||||
assertTrue(pairs_b.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenValueIsNull() throws Exception {
|
||||
List<Pair> pairs = apiClient.parameterToPairs("csv", "param-a", null);
|
||||
|
||||
assertTrue(pairs.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception {
|
||||
// list of empty strings
|
||||
List<String> strs = new ArrayList<String>();
|
||||
strs.add(" ");
|
||||
strs.add(" ");
|
||||
strs.add(" ");
|
||||
|
||||
List<Pair> concatStrings = apiClient.parameterToPairs("csv", "param-a", strs);
|
||||
|
||||
assertEquals(1, concatStrings.size());
|
||||
assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToPairsWhenValueIsCollection() throws Exception {
|
||||
Map<String, String> collectionFormatMap = new HashMap<String, String>();
|
||||
collectionFormatMap.put("csv", ",");
|
||||
collectionFormatMap.put("tsv", "\t");
|
||||
collectionFormatMap.put("ssv", " ");
|
||||
collectionFormatMap.put("pipes", "|");
|
||||
collectionFormatMap.put("", ","); // no format, must default to csv
|
||||
collectionFormatMap.put("unknown", ","); // all other formats, must default to csv
|
||||
|
||||
String name = "param-a";
|
||||
|
||||
List<Object> values = new ArrayList<Object>();
|
||||
values.add("value-a");
|
||||
values.add(123);
|
||||
values.add(new Date());
|
||||
|
||||
// check for multi separately
|
||||
List<Pair> multiPairs = apiClient.parameterToPairs("multi", name, values);
|
||||
assertEquals(values.size(), multiPairs.size());
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue());
|
||||
}
|
||||
|
||||
// all other formats
|
||||
for (String collectionFormat : collectionFormatMap.keySet()) {
|
||||
List<Pair> pairs = apiClient.parameterToPairs(collectionFormat, name, values);
|
||||
|
||||
assertEquals(1, pairs.size());
|
||||
|
||||
String delimiter = collectionFormatMap.get(collectionFormat);
|
||||
if (!delimiter.equals(",")) {
|
||||
// commas are not escaped because they are reserved characters in URIs
|
||||
delimiter = apiClient.escapeString(delimiter);
|
||||
}
|
||||
String[] pairValueSplit = pairs.get(0).getValue().split(delimiter);
|
||||
|
||||
// must equal input values
|
||||
assertEquals(values.size(), pairValueSplit.length);
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSanitizeFilename() {
|
||||
assertEquals("sun", apiClient.sanitizeFilename("sun"));
|
||||
assertEquals("sun.gif", apiClient.sanitizeFilename("sun.gif"));
|
||||
assertEquals("sun.gif", apiClient.sanitizeFilename("../sun.gif"));
|
||||
assertEquals("sun.gif", apiClient.sanitizeFilename("/var/tmp/sun.gif"));
|
||||
assertEquals("sun.gif", apiClient.sanitizeFilename("./sun.gif"));
|
||||
assertEquals("sun.gif", apiClient.sanitizeFilename("..\\sun.gif"));
|
||||
assertEquals("sun.gif", apiClient.sanitizeFilename("\\var\\tmp\\sun.gif"));
|
||||
assertEquals("sun.gif", apiClient.sanitizeFilename("c:\\var\\tmp\\sun.gif"));
|
||||
assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNewHttpClient() {
|
||||
OkHttpClient oldClient = apiClient.getHttpClient();
|
||||
apiClient.setHttpClient(oldClient.newBuilder().build());
|
||||
assertThat(apiClient.getHttpClient(), is(not(oldClient)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the invariant that the HttpClient for the ApiClient must never be null
|
||||
*/
|
||||
@Test(expected = NullPointerException.class)
|
||||
public void testNullHttpClient() {
|
||||
apiClient.setHttpClient(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
package org.openapitools.client;
|
||||
|
||||
import org.openapitools.client.auth.*;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import org.junit.*;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
public class ApiClientTest {
|
||||
ApiClient apiClient = null;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
apiClient = new ApiClient();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void testParseAndFormatDate() {
|
||||
// default date format
|
||||
String dateStr = "2015-11-07T03:49:09.356Z";
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356+00:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09.356Z")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T05:49:09.356+02:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00")));
|
||||
|
||||
// custom date format: without milli-seconds, custom time zone
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT);
|
||||
format.setTimeZone(TimeZone.getTimeZone("GMT+10"));
|
||||
apiClient.setDateFormat(format);
|
||||
dateStr = "2015-11-07T13:49:09+10:00";
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09+00:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T03:49:09Z")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T00:49:09-03:00")));
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T13:49:09+10:00")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsJsonMime() {
|
||||
assertFalse(apiClient.isJsonMime((String) null));
|
||||
assertFalse(apiClient.isJsonMime(""));
|
||||
assertFalse(apiClient.isJsonMime("text/plain"));
|
||||
assertFalse(apiClient.isJsonMime("application/xml"));
|
||||
assertFalse(apiClient.isJsonMime("application/jsonp"));
|
||||
assertFalse(apiClient.isJsonMime("example/json"));
|
||||
assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx"));
|
||||
assertFalse(apiClient.isJsonMime("example/foo+bar+xjson"));
|
||||
|
||||
assertTrue(apiClient.isJsonMime("application/json"));
|
||||
assertTrue(apiClient.isJsonMime("application/json; charset=UTF8"));
|
||||
assertTrue(apiClient.isJsonMime("APPLICATION/JSON"));
|
||||
|
||||
assertTrue(apiClient.isJsonMime("application/problem+json"));
|
||||
assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON"));
|
||||
assertTrue(apiClient.isJsonMime("application/json\t"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+bar+json"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+json;x;y"));
|
||||
assertTrue(apiClient.isJsonMime("example/foo+json\t;"));
|
||||
assertTrue(apiClient.isJsonMime("Example/fOO+JSON"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectHeaderAccept() {
|
||||
String[] accepts = {"application/json", "application/xml"};
|
||||
assertEquals(Arrays.asList(MediaType.parseMediaType("application/json")), apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"};
|
||||
assertEquals(Arrays.asList(MediaType.parseMediaType("APPLICATION/JSON")), apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"application/xml", "application/json; charset=UTF8"};
|
||||
assertEquals(Arrays.asList(MediaType.parseMediaType("application/json; charset=UTF8")), apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{"text/plain", "application/xml"};
|
||||
assertEquals(Arrays.asList(MediaType.parseMediaType("text/plain"),MediaType.parseMediaType("application/xml")), apiClient.selectHeaderAccept(accepts));
|
||||
|
||||
accepts = new String[]{};
|
||||
assertNull(apiClient.selectHeaderAccept(accepts));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSelectHeaderContentType() {
|
||||
String[] contentTypes = {"application/json", "application/xml"};
|
||||
assertEquals(MediaType.parseMediaType("application/json"), apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"};
|
||||
assertEquals(MediaType.parseMediaType("APPLICATION/JSON"), apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"};
|
||||
assertEquals(MediaType.parseMediaType("application/json; charset=UTF8"), apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{"text/plain", "application/xml"};
|
||||
assertEquals(MediaType.parseMediaType("text/plain"), apiClient.selectHeaderContentType(contentTypes));
|
||||
|
||||
contentTypes = new String[]{};
|
||||
assertEquals(MediaType.parseMediaType("application/json"), apiClient.selectHeaderContentType(contentTypes));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAuthentications() {
|
||||
Map<String, Authentication> auths = apiClient.getAuthentications();
|
||||
|
||||
Authentication auth = auths.get("api_key");
|
||||
assertNotNull(auth);
|
||||
assertTrue(auth instanceof ApiKeyAuth);
|
||||
ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth;
|
||||
assertEquals("header", apiKeyAuth.getLocation());
|
||||
assertEquals("api_key", apiKeyAuth.getParamName());
|
||||
|
||||
auth = auths.get("petstore_auth");
|
||||
assertTrue(auth instanceof OAuth);
|
||||
assertSame(auth, apiClient.getAuthentication("petstore_auth"));
|
||||
|
||||
assertNull(auths.get("unknown"));
|
||||
|
||||
try {
|
||||
auths.put("my_auth", new HttpBasicAuth());
|
||||
fail("the authentications returned should not be modifiable");
|
||||
} catch (UnsupportedOperationException e) {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetUsernameAndPassword() {
|
||||
HttpBasicAuth auth = null;
|
||||
for (Authentication _auth : apiClient.getAuthentications().values()) {
|
||||
if (_auth instanceof HttpBasicAuth) {
|
||||
auth = (HttpBasicAuth) _auth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
|
||||
apiClient.setUsername("my-username");
|
||||
apiClient.setPassword("my-password");
|
||||
assertEquals("my-username", auth.getUsername());
|
||||
assertEquals("my-password", auth.getPassword());
|
||||
|
||||
// reset values
|
||||
auth.setUsername(null);
|
||||
auth.setPassword(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetApiKeyAndPrefix() {
|
||||
ApiKeyAuth auth = null;
|
||||
for (Authentication _auth : apiClient.getAuthentications().values()) {
|
||||
if (_auth instanceof ApiKeyAuth) {
|
||||
auth = (ApiKeyAuth) _auth;
|
||||
break;
|
||||
}
|
||||
}
|
||||
auth.setApiKey(null);
|
||||
auth.setApiKeyPrefix(null);
|
||||
|
||||
apiClient.setApiKey("my-api-key");
|
||||
apiClient.setApiKeyPrefix("Token");
|
||||
assertEquals("my-api-key", auth.getApiKey());
|
||||
assertEquals("Token", auth.getApiKeyPrefix());
|
||||
|
||||
// reset values
|
||||
auth.setApiKey(null);
|
||||
auth.setApiKeyPrefix(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToMultiValueMapWhenNameIsInvalid() throws Exception {
|
||||
MultiValueMap<String, String> pairs_a = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, null, new Integer(1));
|
||||
MultiValueMap<String, String> pairs_b = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "", new Integer(1));
|
||||
|
||||
assertTrue(pairs_a.isEmpty());
|
||||
assertTrue(pairs_b.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToMultiValueMapWhenValueIsNull() throws Exception {
|
||||
MultiValueMap<String, String> pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", null);
|
||||
|
||||
assertTrue(pairs.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToMultiValueMapWhenValueIsEmptyStrings() throws Exception {
|
||||
|
||||
// single empty string
|
||||
MultiValueMap<String, String> pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", " ");
|
||||
assertEquals(1, pairs.size());
|
||||
|
||||
// list of empty strings
|
||||
List<String> strs = new ArrayList<String>();
|
||||
strs.add(" ");
|
||||
strs.add(" ");
|
||||
strs.add(" ");
|
||||
|
||||
MultiValueMap<String, String> concatStrings = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, "param-a", strs);
|
||||
|
||||
assertEquals(1, concatStrings.get("param-a").size());
|
||||
assertFalse(concatStrings.get("param-a").isEmpty()); // should contain some delimiters
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToMultiValueMapWhenValueIsNotCollection() throws Exception {
|
||||
String name = "param-a";
|
||||
Integer value = 1;
|
||||
|
||||
MultiValueMap<String, String> pairs = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.CSV, name, value);
|
||||
|
||||
assertEquals(1, pairs.get(name).size());
|
||||
assertEquals(value, Integer.valueOf(pairs.get(name).get(0)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParameterToMultiValueMapWhenValueIsCollection() throws Exception {
|
||||
Map<ApiClient.CollectionFormat, String> collectionFormatMap = new HashMap<ApiClient.CollectionFormat, String>();
|
||||
collectionFormatMap.put(ApiClient.CollectionFormat.CSV, ",");
|
||||
collectionFormatMap.put(ApiClient.CollectionFormat.TSV, "\t");
|
||||
collectionFormatMap.put(ApiClient.CollectionFormat.SSV, " ");
|
||||
collectionFormatMap.put(ApiClient.CollectionFormat.PIPES, "\\|");
|
||||
collectionFormatMap.put(null, ","); // no format, must default to csv
|
||||
|
||||
String name = "param-a";
|
||||
|
||||
List<Object> values = new ArrayList<Object>();
|
||||
values.add("value-a");
|
||||
values.add(123);
|
||||
values.add(new Date());
|
||||
|
||||
// check for multi separately
|
||||
MultiValueMap<String, String> multiValueMap = apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.MULTI, name, values);
|
||||
assertEquals(values.size(), multiValueMap.get(name).size());
|
||||
|
||||
// all other formats
|
||||
for (ApiClient.CollectionFormat collectionFormat : collectionFormatMap.keySet()) {
|
||||
MultiValueMap<String, String> pairs = apiClient.parameterToMultiValueMap(collectionFormat, name, values);
|
||||
|
||||
assertEquals(1, pairs.size());
|
||||
|
||||
String delimiter = collectionFormatMap.get(collectionFormat);
|
||||
String[] pairValueSplit = pairs.get(name).get(0).split(delimiter);
|
||||
|
||||
assertEquals(values.size(), pairValueSplit.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.*;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class ApiKeyAuthTest {
|
||||
@Test
|
||||
public void testApplyToParamsInQuery() {
|
||||
MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
HttpHeaders headerParams = new HttpHeaders();
|
||||
MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
|
||||
ApiKeyAuth auth = new ApiKeyAuth("query", "api_key");
|
||||
auth.setApiKey("my-api-key");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
|
||||
assertEquals(1, queryParams.size());
|
||||
assertEquals("my-api-key", queryParams.get("api_key").get(0));
|
||||
|
||||
// no changes to header or cookie parameters
|
||||
assertEquals(0, headerParams.size());
|
||||
assertEquals(0, cookieParams.size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyToParamsInHeaderWithPrefix() {
|
||||
MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
HttpHeaders headerParams = new HttpHeaders();
|
||||
MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
|
||||
ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN");
|
||||
auth.setApiKey("my-api-token");
|
||||
auth.setApiKeyPrefix("Token");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
|
||||
// no changes to query or cookie parameters
|
||||
assertEquals(0, queryParams.size());
|
||||
assertEquals(0, cookieParams.size());
|
||||
assertEquals(1, headerParams.size());
|
||||
assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN").get(0));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyToParamsInCookieWithPrefix() {
|
||||
MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
HttpHeaders headerParams = new HttpHeaders();
|
||||
MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
|
||||
ApiKeyAuth auth = new ApiKeyAuth("cookie", "X-API-TOKEN");
|
||||
auth.setApiKey("my-api-token");
|
||||
auth.setApiKeyPrefix("Token");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
|
||||
// no changes to query or cookie parameters
|
||||
assertEquals(0, queryParams.size());
|
||||
assertEquals(0, headerParams.size());
|
||||
assertEquals(1, cookieParams.size());
|
||||
assertEquals("Token my-api-token", cookieParams.get("X-API-TOKEN").get(0));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.openapitools.client.auth;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.*;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class HttpBasicAuthTest {
|
||||
HttpBasicAuth auth = null;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
auth = new HttpBasicAuth();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testApplyToParams() {
|
||||
MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();
|
||||
HttpHeaders headerParams = new HttpHeaders();
|
||||
MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();
|
||||
|
||||
auth.setUsername("my-username");
|
||||
auth.setPassword("my-password");
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
|
||||
// no changes to query or cookie parameters
|
||||
assertEquals(0, queryParams.size());
|
||||
assertEquals(0, cookieParams.size());
|
||||
assertEquals(1, headerParams.size());
|
||||
// the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix
|
||||
String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ=";
|
||||
assertEquals(expected, headerParams.get("Authorization").get(0));
|
||||
|
||||
// null username should be treated as empty string
|
||||
auth.setUsername(null);
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
// the string below is base64-encoded result of ":my-password" with the "Basic " prefix
|
||||
expected = "Basic Om15LXBhc3N3b3Jk";
|
||||
assertEquals(expected, headerParams.get("Authorization").get(1));
|
||||
|
||||
// null password should be treated as empty string
|
||||
auth.setUsername("my-username");
|
||||
auth.setPassword(null);
|
||||
auth.applyToParams(queryParams, headerParams, cookieParams);
|
||||
// the string below is base64-encoded result of "my-username:" with the "Basic " prefix
|
||||
expected = "Basic bXktdXNlcm5hbWU6";
|
||||
assertEquals(expected, headerParams.get("Authorization").get(2));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.openapitools.client.model;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ObjectWriter;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
public class EnumValueTest {
|
||||
|
||||
@Test
|
||||
public void testEnumClass() {
|
||||
assertEquals(EnumClass._ABC.toString(), "_abc");
|
||||
assertEquals(EnumClass._EFG.toString(), "-efg");
|
||||
assertEquals(EnumClass._XYZ_.toString(), "(xyz)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEnumTest() {
|
||||
// test enum value
|
||||
EnumTest enumTest = new EnumTest();
|
||||
enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER);
|
||||
enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1);
|
||||
enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1);
|
||||
|
||||
assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER");
|
||||
assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER");
|
||||
assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower");
|
||||
assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower");
|
||||
|
||||
assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1");
|
||||
assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1);
|
||||
assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1");
|
||||
assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1);
|
||||
|
||||
assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1");
|
||||
assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1);
|
||||
assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2");
|
||||
assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2);
|
||||
|
||||
try {
|
||||
// test serialization (object => json)
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
|
||||
ObjectWriter ow = mapper.writer();
|
||||
String json = ow.writeValueAsString(enumTest);
|
||||
assertEquals(json, "{\"enum_string\":\"lower\",\"enum_string_required\":null,\"enum_integer\":1,\"enum_number\":1.1,\"outerEnum\":null}");
|
||||
|
||||
// test deserialization (json => object)
|
||||
EnumTest fromString = mapper.readValue(json, EnumTest.class);
|
||||
assertEquals(fromString.getEnumString().toString(), "lower");
|
||||
assertEquals(fromString.getEnumInteger().toString(), "1");
|
||||
assertEquals(fromString.getEnumNumber().toString(), "1.1");
|
||||
|
||||
} catch (Exception e) {
|
||||
fail("Exception thrown during serialization/deserialzation of JSON: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
46
CI/samples.ci/client/petstore/kotlin-string/pom.xml
Normal file
46
CI/samples.ci/client/petstore/kotlin-string/pom.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>KotlinPetstoreStringTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>kotlin-string</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>gradle</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
46
CI/samples.ci/client/petstore/kotlin-threetenbp/pom.xml
Normal file
46
CI/samples.ci/client/petstore/kotlin-threetenbp/pom.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>KotlinPetstoreThreetenbpTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>kotlin-threetenbp</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>gradle</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,26 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>TypeScriptAngularBuildPestoreClientTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>TS Fetch Default Petstore Client</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,59 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>TypeScriptAngularBuildES6PestoreClientTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>TS Fetch ES6 Petstore Client</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>npm-install</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>install</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,26 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>TypeScriptAngularBuildPestoreClientTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>TS Fetch Multiple Parameters Petstore Client</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,73 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>TypeScriptFetchBuildPrefixParameterInterfacesPestoreClientTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>TS Fetch Petstore Client (with namespacing for parameter interfaces)</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>npm-install</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>install</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm-build</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>run</argument>
|
||||
<argument>build</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,73 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>TypeScriptAngularBuildWithNPMVersionPestoreClientTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>TS Fetch Petstore Client (with npm)</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>npm-install</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>install</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm-build</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>run</argument>
|
||||
<argument>build</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,59 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>TypeScriptFetchPestoreClientTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>TS Fetch Petstore Test Client</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>npm-install</id>
|
||||
<phase>pre-integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>install</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>npm-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>npm</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>PlayServerTests-api-package-override</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>java-play-framework-api-package-override Project</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Play Test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sbt</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>PlayServerTests-controller-only</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>java-play-framework-controller-only Project</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Play Test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sbt</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>PlayServerTests-fake-endpoints</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>java-play-framework-fake-endpoints Project</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Play Test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sbt</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>PlayServerTests-no-bean-validation</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>java-play-framework-no-bean-validation Project</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Play Test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sbt</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>PlayServerTests-no-exception-handling</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>java-play-framework-no-exception-handling Project</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Play Test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sbt</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>PlayServerTests-no-interface</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>java-play-framework-no-interface Project</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Play Test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sbt</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>PlayServerTests-no-swagger-ui</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>java-play-framework-no-swagger-ui Project</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Play Test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sbt</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>PlayServerTests-no-wrap-calls</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>java-play-framework-no-wrap-calls Project</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Play Test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sbt</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
46
CI/samples.ci/server/petstore/java-play-framework/pom.xml
Normal file
46
CI/samples.ci/server/petstore/java-play-framework/pom.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>PlayServerTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>java-play-framework Project</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>Play Test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>sbt</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
46
CI/samples.ci/server/petstore/kotlin-server/ktor/pom.xml
Normal file
46
CI/samples.ci/server/petstore/kotlin-server/ktor/pom.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>KotlinPetstoreKtorTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>kotlin-server-ktor</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>gradle</executable>
|
||||
<arguments>
|
||||
<argument>test</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1 @@
|
||||
c2fcc2ae9693a8e8d02b25e286844aad88188fcb
|
||||
Binary file not shown.
@@ -4,7 +4,7 @@
|
||||
|
||||
- If you're not using the latest master to generate API clients or server stubs, please give it another try by pulling the latest master as the issue may have already been addressed. Ref: [Getting Started](https://github.com/openapitools/openapi-generator#getting-started)
|
||||
- Search the [open issue](https://github.com/openapitools/openapi-generator/issues) and [closed issue](https://github.com/openapitools/openapi-generator/issues?q=is%3Aissue+is%3Aclosed) to ensure no one else has reported something similar before.
|
||||
- File an [issue ticket](https://github.com/openapitools/openapi-generator/issues/new) by providing all the required information. Failure to provide enough detail may result in slow response from the community.
|
||||
- File an [issue ticket](https://github.com/openapitools/openapi-generator/issues/new) by providing all the required information.
|
||||
- Test with the latest master by building the JAR locally to see if the issue has already been addressed.
|
||||
- You can also make a suggestion or ask a question by opening an "issue".
|
||||
|
||||
@@ -49,7 +49,6 @@ Code change should conform to the programming style guide of the respective lang
|
||||
- C++: https://google.github.io/styleguide/cppguide.html
|
||||
- C++ (Tizen): https://wiki.tizen.org/Native_Platform_Coding_Idiom_and_Style_Guide#C.2B.2B_Coding_Style
|
||||
- Clojure: https://github.com/bbatsov/clojure-style-guide
|
||||
- Crystal: https://crystal-lang.org/reference/conventions/coding_style.html
|
||||
- Dart: https://www.dartlang.org/guides/language/effective-dart/style
|
||||
- Elixir: https://github.com/christopheradams/elixir_style_guide
|
||||
- Eiffel: https://www.eiffel.org/doc/eiffel/Coding%20Standards
|
||||
@@ -86,14 +85,11 @@ For [Vendor Extensions](https://github.com/OAI/OpenAPI-Specification/blob/master
|
||||
To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapitools/codegen](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/test/java/org/openapitools/codegen)
|
||||
|
||||
To test the templates, please perform the following:
|
||||
|
||||
- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh .
|
||||
/bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion)
|
||||
- During development it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`.
|
||||
- Run the tests in the sample folder using maven `mvn integration-test -f /path/to/pom.xml`, e.g. `mvn integration-test -f samples/client/petstore/python/pom.xml`. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests)
|
||||
- Update the Petstore sample by running the shell scripts under `bin` and `bin/openapi3` folder. For example, run `./bin/python-petstore.sh` and `./bin/openapi3/python-petstore.sh` to update the Python PetStore API client under [`samples/client/petstore/python`](https://github.com/openapitools/openapi-generator/tree/master/samples/client/petstore/python) and [`samples/openapi3/client/petstore/python`](https://github.com/openapitools/openapi-generator/tree/master/samples/openapi3/client/petstore/python). For Windows, the batch files can be found under `bin\windows` folder. (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion)
|
||||
- Run the tests in the sample folder using maven `mvn integration-test -rf :<artifactId>`, e.g. open a shell in `samples/client/petstore/python`, run `mvn integration-test -rf :PythonPetstoreClientTests`. The artifactId of the project can be found in the pom.xml file. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests)
|
||||
- Finally, git commit the updated samples files: `git commit -a`
|
||||
(`git add -A` if added files with new test cases)
|
||||
- For new test cases, please add to the [Fake Petstore spec](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml)
|
||||
- For new test cases, please add to the [Fake Petstore spec](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml)
|
||||
|
||||
To start the CI tests, you can:
|
||||
- Run `mvn verify -Psamples`, assuming you have all the required tools installed to run tests for different languages.
|
||||
@@ -108,8 +104,7 @@ See [OpenAPI Tools wiki](https://github.com/OpenAPITools/openapi-generator/wiki/
|
||||
- Add test case(s) to cover the change
|
||||
- Document the fix in the code to make the code more readable
|
||||
- Make sure test cases passed after the change (one way is to leverage https://travis-ci.org/ to run the CI tests)
|
||||
- File a PR with meaningful title, description and commit messages
|
||||
- Make sure the option "Allow edits from maintainers" in the PR is selected so that the maintainers can update your PRs with minor fixes, if needed.
|
||||
- File a PR with meaningful title, description and commit messages.
|
||||
- Recommended git settings
|
||||
- `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around
|
||||
- To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. `fix #1542`. (Ref: [closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
FROM maven:3.6.3-jdk-11-openj9
|
||||
FROM jimschubert/8-jdk-alpine-mvn:1.0
|
||||
|
||||
RUN set -x && \
|
||||
apk add --no-cache bash
|
||||
|
||||
ENV GEN_DIR /opt/openapi-generator
|
||||
WORKDIR ${GEN_DIR}
|
||||
@@ -26,6 +29,6 @@ RUN mvn -am -pl "modules/openapi-generator-cli" package
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
RUN ln -s /usr/local/bin/docker-entrypoint.sh /usr/local/bin/openapi-generator
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
CMD ["help"]
|
||||
|
||||
196
README.md
196
README.md
@@ -1,38 +1,21 @@
|
||||
<h1 align="center">OpenAPI Generator</h1>
|
||||
|
||||
|
||||
<div align="center">
|
||||
|
||||
[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22) [](./LICENSE) [](https://opencollective.com/openapi_generator) [](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM) [](https://twitter.com/oas_generator)
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.0.0`): [](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">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.0.1`):
|
||||
[](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)
|
||||
[](https://github.com/OpenAPITools/openapi-generator/actions?query=workflow%3A%22Check+Supported+Java+Versions%22)
|
||||
|
||||
[5.1.x](https://github.com/OpenAPITools/openapi-generator/tree/5.1.x) (`5.1.x`):
|
||||
[](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)
|
||||
|
||||
[6.0.x](https://github.com/OpenAPITools/openapi-generator/tree/6.0.x) (`6.0.x`):
|
||||
[](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)
|
||||
[](https://join.slack.com/t/openapi-generator/shared_invite/enQtNzAyNDMyOTU0OTE1LTY5ZDBiNDI5NzI5ZjQ1Y2E5OWVjMjZkYzY1ZGM2MWQ4YWFjMzcyNDY5MGI4NjQxNDBiMTlmZTc5NjY2ZTQ5MGM)
|
||||
[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22)
|
||||
[](https://twitter.com/oas_generator)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -46,7 +29,7 @@
|
||||
|
||||
:notebook_with_decorative_cover: The eBook [A Beginner's Guide to Code Generation for REST APIs](https://gum.co/openapi_generator_ebook) is a good starting point for beginners :notebook_with_decorative_cover:
|
||||
|
||||
:warning: If the OpenAPI spec, templates or any input (e.g. options, environment variables) is obtained from an untrusted source or environment, please make sure you've reviewed these inputs before using OpenAPI Generator to generate the API client, server stub or documentation to avoid potential security issues (e.g. [code injection](https://en.wikipedia.org/wiki/Code_injection)). For security vulnerabilities, please contact [team@openapitools.org](mailto:team@openapitools.org). :warning:
|
||||
:warning: If the OpenAPI spec, templates or any input (e.g. options, environment variables) is obtained from an untrusted source or environment, please make sure you've reviewed these inputs before using OpenAPI Generator to generate the API client, server stub or documentation to avoid potential security issues (e.g. [code injection](https://en.wikipedia.org/wiki/Code_injection)) :warning:
|
||||
|
||||
:bangbang: Both "OpenAPI Tools" (https://OpenAPITools.org - the parent organization of OpenAPI Generator) and "OpenAPI Generator" are not affiliated with OpenAPI Initiative (OAI) :bangbang:
|
||||
|
||||
@@ -62,8 +45,6 @@ If you find OpenAPI Generator useful for work, please consider asking your compa
|
||||
[](https://www.lightbow.net/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/docspring.png" width="128" height="128">](https://docspring.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/datadog.png" width="128" height="128">](https://datadoghq.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/thales.jpg" width="128" height="128">](https://cpl.thalesgroup.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
[<img src="https://openapi-generator.tech/img/companies/apideck.jpg" width="128" height="128">](https://www.apideck.com/?utm_source=openapi_generator&utm_medium=github_webpage&utm_campaign=sponsor)
|
||||
|
||||
#### Thank you GoDaddy for sponsoring the domain names, Linode for sponsoring the VPS and Checkly for sponsoring the API monitoring
|
||||
|
||||
@@ -77,11 +58,11 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
|
||||
|
||||
| | Languages/Frameworks |
|
||||
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0, .NET 5.0), **C++** (cpp-restsdk, Qt5, Tizen, Unreal Engine 4), **Clojure**, **Crystal**, **Dart**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (hyper, reqwest, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 11.x), Aurelia, Axios, Fetch, Inversify, jQuery, Nestjs, Node, redux-query, Rxjs) |
|
||||
| **API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C**, **C#** (.net 2.0, 3.5 or later, .NET Standard 1.3 - 2.0, .NET Core 2.0), **C++** (cpp-restsdk, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client, MicroProfile Rest Client), **k6**, **Kotlin**, **Lua**, **Nim**, **Node.js/JavaScript** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types, Apollo GraphQL DataStore), **Objective-C**, **OCaml**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, sttp, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x, 5.x), **Typescript** (AngularJS, Angular (2.x - 8.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node, Rxjs) |
|
||||
| **Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed, Qt5 QHTTPEngine), **Erlang**, **F#** (Giraffe), **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, Jersey, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples), [Vert.x](https://vertx.io/)), **Kotlin** (Spring Boot, Ktor, Vertx), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** (Akka, [Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), [Play](https://www.playframework.com/), Scalatra) |
|
||||
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc**, **Markdown**, **PlantUML** |
|
||||
| **API documentation generators** | **HTML**, **Confluence Wiki**, **Asciidoc** |
|
||||
| **Configuration files** | [**Apache2**](https://httpd.apache.org/) |
|
||||
| **Others** | **GraphQL**, **JMeter**, **Ktorm**, **MySQL Schema**, **Protocol Buffer** |
|
||||
| **Others** | **GraphQL**, **JMeter**, **MySQL Schema**, **Protocol Buffer** |
|
||||
|
||||
## Table of contents
|
||||
|
||||
@@ -95,7 +76,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
|
||||
- [1.4 - Build Projects](#14---build-projects)
|
||||
- [1.5 - Homebrew](#15---homebrew)
|
||||
- [1.6 - Docker](#16---docker)
|
||||
- [1.7 - NPM](#17---npm)
|
||||
- [1.7 - NPM](#17---npm)
|
||||
- [2 - Getting Started](#2---getting-started)
|
||||
- [3 - Usage](#3---usage)
|
||||
- [3.1 - Customization](#31---customization)
|
||||
@@ -119,11 +100,8 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20
|
||||
|
||||
| OpenAPI Generator Version | Release Date | Notes |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- |
|
||||
| 6.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.0.0-SNAPSHOT/) | Nov/Dec 2021 | Minor release with breaking changes (no fallback) |
|
||||
| 5.1.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.1.0-SNAPSHOT/) | Mar/Apr 2021 | Minor release with breaking changes (with fallback) |
|
||||
| 5.0.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.1-SNAPSHOT/) | Jan/Feb 2021 | Patch release with enhancements, bug fixes, etc |
|
||||
| [5.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.0.0) (latest stable release) | 21.12.2020 | Major release with breaking changes (no fallback) |
|
||||
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
|
||||
| 5.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.0.0-SNAPSHOT/) | 17.06.2020 | Major release with breaking changes (no fallback) |
|
||||
| [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) (latest stable release) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) |
|
||||
|
||||
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
|
||||
|
||||
@@ -179,16 +157,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: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.0.0/openapi-generator-cli-5.0.0.jar`
|
||||
JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.0.0/openapi-generator-cli-5.0.0.jar -O openapi-generator-cli.jar
|
||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.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 https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.0.0/openapi-generator-cli-5.0.0.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -272,14 +250,13 @@ To install, run `brew install openapi-generator`
|
||||
|
||||
Here is an example usage to generate a Ruby client:
|
||||
```sh
|
||||
openapi-generator generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby -o /tmp/test/
|
||||
openapi-generator generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby -o /tmp/test/
|
||||
```
|
||||
|
||||
To reinstall with the latest master, run `brew uninstall openapi-generator && brew install --HEAD openapi-generator`
|
||||
|
||||
To install OpenJDK (pre-requisites), please run
|
||||
```sh
|
||||
brew tap AdoptOpenJDK/openjdk
|
||||
brew cask install adoptopenjdk12
|
||||
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home/
|
||||
```
|
||||
@@ -307,7 +284,7 @@ Example:
|
||||
|
||||
```sh
|
||||
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
|
||||
-i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \
|
||||
-i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
|
||||
-g go \
|
||||
-o /local/out/go
|
||||
```
|
||||
@@ -332,12 +309,12 @@ GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID)
|
||||
|
||||
# Execute an HTTP request to generate a Ruby client
|
||||
> curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' \
|
||||
-d '{"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml"}' \
|
||||
-d '{"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' \
|
||||
'http://localhost:8888/api/gen/clients/ruby'
|
||||
|
||||
{"code":"c2d483.3.4672-40e9-91df-b9ffd18d22b8","link":"http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8"}
|
||||
|
||||
# Download the generated zip file
|
||||
# Download the generated zip file
|
||||
> wget http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8
|
||||
|
||||
# Unzip the file
|
||||
@@ -368,8 +345,8 @@ Once built, `run-in-docker.sh` will act as an executable for openapi-generator-c
|
||||
./run-in-docker.sh help # Executes 'help' command for openapi-generator-cli
|
||||
./run-in-docker.sh list # Executes 'list' command for openapi-generator-cli
|
||||
./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client
|
||||
./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml \
|
||||
-g go -o /gen/out/go-petstore --package-name=petstore # generates go client, outputs locally to ./out/go-petstore
|
||||
./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
|
||||
-g go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore
|
||||
```
|
||||
|
||||
##### Troubleshooting
|
||||
@@ -406,14 +383,14 @@ Install it globally to get the CLI available on the command line:
|
||||
|
||||
```sh
|
||||
npm install @openapitools/openapi-generator-cli -g
|
||||
openapi-generator-cli version
|
||||
openapi-generator version
|
||||
```
|
||||
|
||||
<!-- RELEASE_VERSION -->
|
||||
To use a specific version of "openapi-generator-cli"
|
||||
Or install a particular OpenAPI Generator version (e.g. v4.3.1):
|
||||
|
||||
```sh
|
||||
openapi-generator-cli version-manager set 5.0.0
|
||||
npm install @openapitools/openapi-generator-cli@cli-4.3.1 -g
|
||||
```
|
||||
|
||||
Or install it as dev-dependency:
|
||||
@@ -424,20 +401,20 @@ npm install @openapitools/openapi-generator-cli -D
|
||||
<!-- /RELEASE_VERSION -->
|
||||
## [2 - Getting Started](#table-of-contents)
|
||||
|
||||
To generate a PHP client for [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml), please run the following
|
||||
To generate a PHP client for [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml), please run the following
|
||||
```sh
|
||||
git clone https://github.com/openapitools/openapi-generator
|
||||
cd openapi-generator
|
||||
mvn clean package
|
||||
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/3_0/petstore.yaml \
|
||||
-i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
|
||||
-g php \
|
||||
-o /var/tmp/php_api_client
|
||||
```
|
||||
(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/3_0/petstore.yaml -g php -o c:\temp\php_api_client`)
|
||||
(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](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.0.0/openapi-generator-cli-5.0.0.jar)
|
||||
You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.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`
|
||||
@@ -447,22 +424,20 @@ To get a list of PHP specified options (which can be passed to the generator wit
|
||||
## [3 - Usage](#table-of-contents)
|
||||
|
||||
### To generate a sample client library
|
||||
You can build a client against the [Petstore API](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) as follows:
|
||||
You can build a client against the [Petstore API](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml) as follows:
|
||||
|
||||
```sh
|
||||
./bin/generate-samples.sh ./bin/configs/java-okhttp-gson.yaml
|
||||
./bin/java-petstore-okhttp-gson.sh
|
||||
```
|
||||
|
||||
(On Windows, please install [GIT Bash for Windows](https://gitforwindows.org/) to run the command above)
|
||||
(On Windows, run `.\bin\windows\java-petstore-okhttp-gson.bat` instead)
|
||||
|
||||
This script uses the default library, which is `okhttp-gson`. It will run the generator with this command:
|
||||
|
||||
```sh
|
||||
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/3_0/petstore.yaml \
|
||||
-i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
|
||||
-g java \
|
||||
-t modules/openapi-generator/src/main/resources/Java \
|
||||
--additional-properties artifactId=petstore-okhttp-gson,hideGenerationTimestamp:true \
|
||||
-o samples/client/petstore/java/okhttp-gson
|
||||
```
|
||||
|
||||
@@ -478,28 +453,29 @@ NAME
|
||||
SYNOPSIS
|
||||
openapi-generator-cli generate
|
||||
[(-a <authorization> | --auth <authorization>)]
|
||||
[--api-name-suffix <api name suffix>] [--api-package <api package>]
|
||||
[--artifact-id <artifact id>] [--artifact-version <artifact version>]
|
||||
[(-c <configuration file> | --config <configuration file>)] [--dry-run]
|
||||
[--api-name-suffix <api name suffix>]
|
||||
[--api-package <api package>] [--artifact-id <artifact id>]
|
||||
[--artifact-version <artifact version>]
|
||||
[(-c <configuration file> | --config <configuration file>)]
|
||||
[-D <system properties>...]
|
||||
[(-e <templating engine> | --engine <templating engine>)]
|
||||
[--enable-post-process-file]
|
||||
[(-g <generator name> | --generator-name <generator name>)]
|
||||
[--generate-alias-as-model] [--git-host <git host>]
|
||||
[--git-repo-id <git repo id>] [--git-user-id <git user id>]
|
||||
[--global-property <global properties>...] [--group-id <group id>]
|
||||
[--generate-alias-as-model] [--git-repo-id <git repo id>]
|
||||
[--git-user-id <git user id>] [--group-id <group id>]
|
||||
[--http-user-agent <http user agent>]
|
||||
[(-i <spec file> | --input-spec <spec file>)]
|
||||
(-i <spec file> | --input-spec <spec file>)
|
||||
[--ignore-file-override <ignore file override location>]
|
||||
[--import-mappings <import mappings>...]
|
||||
[--instantiation-types <instantiation types>...]
|
||||
[--invoker-package <invoker package>]
|
||||
[--language-specific-primitives <language specific primitives>...]
|
||||
[--legacy-discriminator-behavior] [--library <library>]
|
||||
[--log-to-stderr] [--minimal-update]
|
||||
[--library <library>] [--log-to-stderr] [--minimal-update]
|
||||
[--model-name-prefix <model name prefix>]
|
||||
[--model-name-suffix <model name suffix>]
|
||||
[--model-package <model package>]
|
||||
[(-o <output directory> | --output <output directory>)] [(-p <additional properties> | --additional-properties <additional properties>)...]
|
||||
[(-o <output directory> | --output <output directory>)]
|
||||
[(-p <additional properties> | --additional-properties <additional properties>)...]
|
||||
[--package-name <package name>] [--release-note <release note>]
|
||||
[--remove-operation-id-prefix]
|
||||
[--reserved-words-mappings <reserved word mappings>...]
|
||||
@@ -528,7 +504,14 @@ cd samples/client/petstore/java/okhttp-gson
|
||||
mvn package
|
||||
```
|
||||
|
||||
Other generators have [samples](https://github.com/OpenAPITools/openapi-generator/tree/master/samples) too.
|
||||
Other languages have petstore samples, too:
|
||||
```sh
|
||||
./bin/android-petstore-all.sh
|
||||
./bin/java-petstore-all.sh
|
||||
./bin/objc-petstore.sh
|
||||
```
|
||||
|
||||
... and others. [Here is a list of all scripts.](https://github.com/OpenAPITools/openapi-generator/wiki/Samples-folder#scripts)
|
||||
|
||||
### [3.1 - Customization](#table-of-contents)
|
||||
|
||||
@@ -576,7 +559,6 @@ Here is a list of community-conitributed IDE plug-ins that integrate with OpenAP
|
||||
Here are some companies/projects (alphabetical order) using OpenAPI Generator in production. To add your company/project to the list, please visit [README.md](README.md) and click on the icon to edit the page.
|
||||
|
||||
- [Adaptant Solutions AG](https://www.adaptant.io/)
|
||||
- [adesso SE](https://www.adesso.de/)
|
||||
- [Agoda](https://www.agoda.com/)
|
||||
- [Allianz](https://www.allianz.com)
|
||||
- [Angular.Schule](https://angular.schule/)
|
||||
@@ -594,7 +576,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [Camptocamp](https://www.camptocamp.com/en)
|
||||
- [Cisco](https://www.cisco.com/)
|
||||
- [codecentric AG](https://www.codecentric.de/)
|
||||
- [CoinAPI](https://www.coinapi.io/)
|
||||
- [Commencis](https://www.commencis.com/)
|
||||
- [Crossover Health](https://crossoverhealth.com/)
|
||||
- [Cupix](https://www.cupix.com/)
|
||||
@@ -617,7 +598,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [GoDaddy](https://godaddy.com)
|
||||
- [Here](https://developer.here.com/)
|
||||
- [IBM](https://www.ibm.com/)
|
||||
- [Instana](https://www.instana.com)
|
||||
- [JustStar](https://www.juststarinfo.com)
|
||||
- [k6.io](https://k6.io/)
|
||||
- [Klarna](https://www.klarna.com/)
|
||||
@@ -625,50 +605,39 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [Kubernetes](https://kubernetes.io)
|
||||
- [Linode](https://www.linode.com/)
|
||||
- [Logicdrop](https://www.logicdrop.com)
|
||||
- [LVM Versicherungen](https://www.lvm.de)
|
||||
- [MailSlurp](https://www.mailslurp.com)
|
||||
- [Médiavision](https://www.mediavision.fr/)
|
||||
- [Metaswitch](https://www.metaswitch.com/)
|
||||
- [MoonVision](https://www.moonvision.io/)
|
||||
- [Myworkout](https://myworkout.com)
|
||||
- [NamSor](https://www.namsor.com/)
|
||||
- [Nokia](https://www.nokia.com/)
|
||||
- [Options Clearing Corporation (OCC)](https://www.theocc.com/)
|
||||
- [Openet](https://www.openet.com/)
|
||||
- [openVALIDATION](https://openvalidation.io/)
|
||||
- [Oracle](https://www.oracle.com/)
|
||||
- [Paxos](https://www.paxos.com)
|
||||
- [PLAID, Inc.](https://plaid.co.jp/)
|
||||
- [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)
|
||||
- [Raksul](https://corp.raksul.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)
|
||||
- [Robotinfra](https://www.robotinfra.com)
|
||||
- [SmartHR](https://smarthr.co.jp/)
|
||||
- [Sony Interactive Entertainment](https://www.sie.com/en/index.html)
|
||||
- [Splitit](https://www.splitit.com/)
|
||||
- [Stingray](http://www.stingray.com)
|
||||
- [Suva](https://www.suva.ch/)
|
||||
- [Telstra](https://dev.telstra.com)
|
||||
- [TravelTime platform](https://www.traveltimeplatform.com/)
|
||||
- [TribalScale](https://www.tribalscale.com)
|
||||
- [TUI InfoTec GmbH](http://www.tui-infotec.com/)
|
||||
- [Twitter](https://twitter.com)
|
||||
- [unblu inc.](https://www.unblu.com/)
|
||||
- [Veamly](https://www.veamly.com/)
|
||||
- [wbt-solutions](https://www.wbt-solutions.de/)
|
||||
- [Woleet](https://www.woleet.io/)
|
||||
- [WSO2](https://wso2.com/)
|
||||
- [Vouchery.io](https://vouchery.io)
|
||||
- [Xero](https://www.xero.com/)
|
||||
- [Yahoo Japan](https://www.yahoo.co.jp/)
|
||||
- [viadee](https://www.viadee.de/)
|
||||
- [Vonage](https://vonage.com)
|
||||
- [YITU Technology](https://www.yitutech.com/)
|
||||
- [Yelp](https://www.yelp.com/)
|
||||
@@ -695,7 +664,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- 2019/01/03 - [Calling a Swagger service from Apex using openapi-generator](https://lekkimworld.com/2019/01/03/calling-a-swagger-service-from-apex-using-openapi-generator/) by [Mikkel Flindt Heisterberg](https://lekkimworld.com)
|
||||
- 2019/01/13 - [OpenAPI GeneratorでRESTful APIの定義書から色々自動生成する](https://ky-yk-d.hatenablog.com/entry/2019/01/13/234108) by [@ky_yk_d](https://twitter.com/ky_yk_d)
|
||||
- 2019/01/20 - [Contract-First API Development with OpenAPI Generator and Connexion](https://medium.com/commencis/contract-first-api-development-with-openapi-generator-and-connexion-b21bbf2f9244) by [Anil Can Aydin](https://github.com/anlcnydn)
|
||||
- 2019/01/30 - [Rapid Application Development With API First Approach Using Open-API Generator](https://dzone.com/articles/rapid-api-development-using-open-api-generator) by [Milan Sonkar](https://dzone.com/users/828329/milan_sonkar.html)
|
||||
- 2019/01/30 - [Rapid Application Development With API First Approach Using Open-API Generator](https://dzone.com/articles/rapid-api-development-using-open-api-generator) by [Milan Sonkar](https://dzone.com/users/828329/milan_sonkar.html)
|
||||
- 2019/02/02 - [平静を保ち、コードを生成せよ 〜 OpenAPI Generator誕生の背景と軌跡 〜](https://speakerdeck.com/akihito_nakano/gunmaweb34) by [中野暁人](https://github.com/ackintosh) at [Gunma.web #34 スキーマ駆動開発](https://gunmaweb.connpass.com/event/113974/)
|
||||
- 2019/02/20 - [An adventure in OpenAPI V3 code generation](https://mux.com/blog/an-adventure-in-openapi-v3-api-code-generation/) by [Phil Cluff](https://mux.com/blog/author/philc/)
|
||||
- 2019/02/26 - [Building API Services: A Beginner’s Guide](https://medium.com/google-cloud/building-api-services-a-beginners-guide-7274ae4c547f) by [Ratros Y.](https://medium.com/@ratrosy) in [Google Cloud Platofrm Blog](https://medium.com/google-cloud)
|
||||
@@ -782,33 +751,6 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- 2020-05-18 - [Spring Boot REST with OpenAPI 3](https://dev.to/alfonzjanfrithz/spring-boot-rest-with-openapi-3-59jm) by [Alfonz Jan Frithz](https://dev.to/alfonzjanfrithz)
|
||||
- 2020-05-19 - [Dead Simple APIs with Open API](https://www.youtube.com/watch?v=sIaXmR6xRAw) by [Chris Tankersley](https://github.com/dragonmantank) at [Nexmo](https://developer.nexmo.com/)
|
||||
- 2020-05-22 - [TypeScript REST API Client](https://dev.to/unhurried/typescript-rest-api-client-4in3) by ["unhurried"](https://dev.to/unhurried)
|
||||
- 2020-05-28 - [【使用 lotify + Swagger 建置可共用的 LINE Notify bot】 - #NiJia @ Chatbot Developer Taiwan 第 #19 小聚](https://www.youtube.com/watch?v=agYVz6dzh1I) by [Chatbot Developer Taiwan](https://www.youtube.com/channel/UCxeYUyZNnHmpX23YNF-ewvw)
|
||||
- 2020-05-28 - [Building APIs with Laravel using OpenAPI](https://www.youtube.com/watch?v=xexLvQqAhiA) by [Chris Tankersley](https://github.com/dragonmantank) at [Laracon EU](https://laracon.eu/)
|
||||
- 2020-06-12 - [Interoperability by construction: code generation for Arrowhead Clients](https://ieeexplore.ieee.org/document/9274746) by Michele Albano, Brian Nielsen at [2020 IEEE Conference on Industrial Cyberphysical Systems (ICPS)](https://ieeexplore.ieee.org/xpl/conhome/9274544/proceeding)
|
||||
- 2020-06-23 - [新規サーバーアプリケーションにTypeScriptを採用してみた](https://www.cam-inc.co.jp/news/20200623) at [CAM Tech Blog](https://www.cam-inc.co.jp/news/tech-blog/)
|
||||
- 2020-06-29 - [Artifact Abstract: Deployment of APIs on Android Mobile Devices and Microcontrollers](https://ieeexplore.ieee.org/document/9127353) by [Sergio Laso ; Marino Linaje ; Jose Garcia-Alonso ; Juan M. Murillo ; Javier Berrocal](https://ieeexplore.ieee.org/document/9127353/authors#authors) at [2020 IEEE International Conference on Pervasive Computing and Communications (PerCom)](https://ieeexplore.ieee.org/xpl/conhome/9125449/proceeding)
|
||||
- 2020-07-07 - [5 Best API Documentation Tools](https://blog.dreamfactory.com/5-best-api-documentation-tools/) by Susanna Bouse at [DreamFactory Blog](https://blog.dreamfactory.com/)
|
||||
- 2020-07-12 - [Open API 3.0の定義からgolangのサーバコードのスケルトンを作成する](https://qiita.com/professor/items/4cbd04ec084d13057bc2) by [@professor (Qiita Blog)](https://qiita.com/professor)
|
||||
- 2020-07-20 - [Datadog API client libraries now available for Java and Go](https://www.datadoghq.com/blog/java-go-libraries/) by Jordan Obey at [Datadog Blog](https://www.datadoghq.com/blog)
|
||||
- 2020-07-23 - [Generate Client SDK for .NET Core using Open Api](https://dev.to/no0law1/generate-client-sdk-for-net-core-using-open-api-2dgh) by [Nuno Reis](https://dev.to/no0law1)
|
||||
- 2020-07-26 - [Dartのhttp_interceptorライブラリを使うと配列のクエリパラメータが消えてしまう件の応急処置](https://qiita.com/gyamoto/items/eeeff81b6770487319ed) by [@gyamoto](https://qiita.com/gyamoto)
|
||||
- 2020-08-01 - [Generate Angular ReactiveForms from Swagger/OpenAPI](https://dev.to/martinmcwhorter/generate-angular-reactiveforms-from-swagger-openapi-35h9) by [Martin McWhorter](https://dev.to/martinmcwhorter)
|
||||
- 2020-08-03 - [Criando Bibliotecas para APIs RESTful com OpenAPI, Swagger Editor e OpenAPI Generator](https://medium.com/@everisBrasil/criando-bibliotecas-para-apis-restful-com-openapi-swagger-editor-e-openapi-generator-75349a6420fd) by [everis Brasil (an NTT DATA Company)](https://medium.com/@everisBrasil)
|
||||
- 2020-08-19 - [マイクロサービスを連携してみよう](https://thinkit.co.jp/article/17704) by [岡井 裕矢(おかい ゆうや)](https://thinkit.co.jp/author/17588), [泉 勝(いずみ まさる)](https://thinkit.co.jp/author/17705) at [Think IT(シンクイット)](https://thinkit.co.jp/)
|
||||
- 2020-08-25 - [OpenAPI Generator と TypeScript で型安全にフロントエンド開発をしている話](https://tech.smarthr.jp/entry/2020/08/25/135631) at [SmartHR Tech Blog](https://tech.smarthr.jp/)
|
||||
- 2020-09-10 - [Introduction to OpenAPI with Instana](https://www.instana.com/blog/introduction-to-openapi-with-instana/) by [Cedric Ziel](https://www.instana.com/blog/author/cedricziel/) at [Instana Blog](https://www.instana.com/blog/)
|
||||
- 2020-09-17 - [Generate PowerShellSDK using openapi-generator](https://medium.com/@ghufz.learn/generate-powershellsdk-using-openapi-generator-33b700891e33) by [Ghufran Zahidi](https://medium.com/@ghufz.learn)
|
||||
- 2020-09-24 - [How to automate API code generation (OpenAPI/Swagger) and boost productivity - Tutorial with React Native featuring TypeScript](https://medium.com/@sceleski/how-to-automate-api-code-generation-openapi-swagger-and-boost-productivity-1176a0056d8a) by [Sanjin Celeski](https://medium.com/@sceleski)
|
||||
- 2020-09-25 - [Generate OpenAPI Angular Client](https://medium.com/@pguso/generate-openapi-angular-client-8c9288e8bbd4) by [Patric](https://medium.com/@pguso)
|
||||
- 2020-10-24 - [Working with Microsoft Identity - React Native Client](https://www.josephguadagno.net/2020/10/24/working-with-microsoft-identity-react-native-client) by [Joseph Guadagno](https://www.josephguadagno.net/)
|
||||
- 2020-10-31 - [[B2] OpenAPI Specification으로 타입-세이프하게 API 개발하기: 희망편 VS 절망편](https://www.youtube.com/watch?v=J4JHLESAiFk) by 최태건 at [FEConf 2020](https://2020.feconf.kr/)
|
||||
- 2020-11-05 - [Automated REST-Api Code Generation: Wie IT-Systeme miteinander sprechen](https://www.massiveart.com/blog/automated-rest-api-code-generation-wie-it-systeme-miteinander-sprechen) by Stefan Rottensteiner at [MASSIVE ART Blog](https://www.massiveart.com/blog)
|
||||
- 2020-12-01 - [OpenAPI GeneratorでGoのAPIサーバー/クライアントコードを自動生成する](https://qiita.com/saki-engineering/items/b20d8b6074c4da9664a5) by [@saki-engineering](https://qiita.com/saki-engineering)
|
||||
- 2020-12-04 - [Scaling the Test Coverage of OpenAPI Generator for 30+ Programming Languages](https://www.youtube.com/watch?v=7Lke9dHRqT0) by [William Cheng](https://github.com/wing328) at [Open Source Summit Japan + Automotive Linux Summit 2020](https://events.linuxfoundation.org/archive/2020/open-source-summit-japan/) ([Slides](https://speakerdeck.com/wing328/scaling-the-test-coverage-of-openapi-generator-for-30-plus-programming-languages))
|
||||
- 2020-12-09 - [プロジェクトにOpenAPI Generatorで自動生成された型付きAPI Clientを導入した話](https://qiita.com/yoshifujiT/items/905c18700ede23f40840) by [@yoshifujiT](https://github.com/yoshifujiT)
|
||||
- 2020-12-15 - [Next.js + NestJS + GraphQLで変化に追従するフロントエンドへ 〜 ショッピングクーポンの事例紹介](https://techblog.yahoo.co.jp/entry/2020121530052952/) by [小倉 陸](https://github.com/ogugu9) at [Yahoo! JAPAN Tech Blog](https://techblog.yahoo.co.jp/)
|
||||
- 2021-01-08 - [Hello, New API – Part 1](https://www.nginx.com/blog/hello-new-api-part-1/) by [Jeremy Schulman](https://www.nginx.com/people/jeremy-schulman/) at [Major League Baseball](https://www.mlb.com)
|
||||
- 2021-01-18 - [「アプリ開発あるある」を疑うことから始まった、API Clientコードの自動生成【デブスト2020】](https://codezine.jp/article/detail/13406?p=2) by [CodeZine編集部](https://codezine.jp/author/1)
|
||||
|
||||
## [6 - About Us](#table-of-contents)
|
||||
|
||||
@@ -843,12 +785,11 @@ Here is a list of template creators:
|
||||
* C# (.NET Standard 1.3 ): @Gronsak
|
||||
* C# (.NET 4.5 refactored): @jimschubert [:heart:](https://www.patreon.com/jimschubert)
|
||||
* Clojure: @xhh
|
||||
* Crystal: @wing328
|
||||
* Dart: @yissachar
|
||||
* Dart (refactor): @joernahrens
|
||||
* Dart 2: @swipesight
|
||||
* Dart (Jaguar): @jaumard
|
||||
* Dart (Dio): @josh-burton
|
||||
* Dart (Dio): @athornz
|
||||
* Elixir: @niku
|
||||
* Elm: @eriktim
|
||||
* Eiffel: @jvelilla
|
||||
@@ -884,7 +825,7 @@ Here is a list of template creators:
|
||||
* PHP (Guzzle): @baartosz
|
||||
* PowerShell: @beatcracker
|
||||
* PowerShell (refactored in 5.0.0): @wing328
|
||||
* Python: @spacether
|
||||
* Python-experimental: @spacether
|
||||
* R: @ramnov
|
||||
* Ruby (Faraday): @meganemura @dkliban
|
||||
* Rust: @farcaller
|
||||
@@ -902,11 +843,10 @@ Here is a list of template creators:
|
||||
* TypeScript (Angular7): @topce
|
||||
* TypeScript (Axios): @nicokoenig
|
||||
* TypeScript (Fetch): @leonyu
|
||||
* TypeScript (Inversify): @gualtierim
|
||||
* TypeScript (jQuery): @bherila
|
||||
* TypeScript (Nestjs): @vfrank66
|
||||
* TypeScript (Node): @mhardorf
|
||||
* TypeScript (Rxjs): @denyo
|
||||
* TypeScript (Inversify): @gualtierim
|
||||
* TypeScript (redux-query): @petejohansonxo
|
||||
* Server Stubs
|
||||
* Ada: @stcarrez
|
||||
@@ -960,7 +900,6 @@ Here is a list of template creators:
|
||||
* Schema
|
||||
* Avro: @sgadouar
|
||||
* GraphQL: @wing328 [:heart:](https://www.patreon.com/wing328)
|
||||
* Ktorm: @Luiz-Monad
|
||||
* MySQL: @ybelenko
|
||||
* Protocol Buffer: @wing328
|
||||
|
||||
@@ -995,7 +934,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
|
||||
#### Members of Technical Committee
|
||||
|
||||
| Languages/Generators | Member (join date) |
|
||||
| Languages | Member (join date) |
|
||||
| :---------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ActionScript | |
|
||||
| Ada | @stcarrez (2018/02) @michelealbano (2018/02) |
|
||||
@@ -1004,20 +943,19 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| Bash | @frol (2017/07) @bkryza (2017/08) @kenjones-cisco (2017/09) |
|
||||
| C | @zhemant (2018/11) @ityuhui (2019/12) @michelealbano (2020/03) |
|
||||
| C++ | @ravinikam (2017/07) @stkrwork (2017/07) @etherealjoy (2018/02) @martindelille (2018/03) @muttleyxd (2019/08) |
|
||||
| C# | @mandrean (2017/08) @frankyjuang (2019/09) @shibayan (2020/02) |
|
||||
| C# | @mandrean (2017/08), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert) @frankyjuang (2019/09) @shibayan (2020/02) |
|
||||
| Clojure | |
|
||||
| Dart | @swipesight (2018/09) @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) |
|
||||
| Dart | @ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @athornz (2019/12) @amondnet (2019/12) |
|
||||
| Eiffel | @jvelilla (2017/09) |
|
||||
| Elixir | @mrmstn (2018/12) |
|
||||
| Elm | @eriktim (2018/09) |
|
||||
| Erlang | @tsloughter (2017/11) @jfacorro (2018/10) @robertoaloi (2018/10) |
|
||||
| F# | @nmfisher (2019/05) |
|
||||
| Go | @antihax (2017/11) @grokify (2018/07) @kemokemo (2018/09) @jirikuncar (2021/01) |
|
||||
| Go | @antihax (2017/11) @bvwells (2017/12) @grokify (2018/07) @kemokemo (2018/09) @bkabrda (2019/07) |
|
||||
| GraphQL | @renepardon (2018/12) |
|
||||
| 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) @nmuesch (2021/01) |
|
||||
| JMeter | @kannkyo (2021/01) |
|
||||
| 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) @bkabrda (2020/01) |
|
||||
| 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) @yutaka0m (2020/03) |
|
||||
| Lua | @daurnimator (2017/08) |
|
||||
| Nim | |
|
||||
@@ -1030,7 +968,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11) |
|
||||
| R | @Ramanth (2019/07) @saigiridhar21 (2019/07) |
|
||||
| Ruby | @cliffano (2017/07) @zlx (2017/09) @autopp (2019/02) |
|
||||
| Rust | @frol (2017/07) @farcaller (2017/08) @richardwhiuk (2019/07) @paladinzh (2020/05) |
|
||||
| Rust | @frol (2017/07) @farcaller (2017/08) @bjgill (2017/12) @richardwhiuk (2019/07) @paladinzh (2020/05) |
|
||||
| Scala | @clasnake (2017/07), @jimschubert (2017/09) [:heart:](https://www.patreon.com/jimschubert), @shijinkui (2018/01), @ramzimaalej (2018/03), @chameleon82 (2020/03), @Bouillie (2020/04) |
|
||||
| Swift | @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @4brunu (2019/11) |
|
||||
| TypeScript | @TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02) |
|
||||
@@ -1055,7 +993,7 @@ OpenAPI Generator is a fork of [Swagger Codegen](https://github.com/swagger-api/
|
||||
- [Daniel](https://github.com/Danielku15)
|
||||
- [Emiliano Bonassi](https://github.com/emilianobonassi)
|
||||
- [Erik Timmers](https://github.com/eriktim)
|
||||
- [Esteban Gehring](https://github.com/macjohnny)
|
||||
- [Esteban Marin](https://github.com/macjohnny)
|
||||
- [Gustavo Paz](https://github.com/gustavoapaz)
|
||||
- [Javier Velilla](https://github.com/jvelilla)
|
||||
- [Jean-François Côté](https://github.com/JFCote)
|
||||
@@ -1098,7 +1036,7 @@ OpenAPI Generator is a fork of [Swagger Codegen](https://github.com/swagger-api/
|
||||
## [7 - License](#table-of-contents)
|
||||
-------
|
||||
|
||||
Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
Copyright 2018 SmartBear Software
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
39
appveyor.yml
39
appveyor.yml
@@ -1,5 +1,5 @@
|
||||
version: '{branch}-{build}'
|
||||
image: Visual Studio 2019
|
||||
image: Visual Studio 2017
|
||||
hosts:
|
||||
petstore.swagger.io: 127.0.0.1
|
||||
install:
|
||||
@@ -15,14 +15,14 @@ install:
|
||||
# install gradle
|
||||
- ps: |
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
if (!(Test-Path -Path "C:\gradle\gradle-5.6.4" )) {
|
||||
if (!(Test-Path -Path "C:\gradle" )) {
|
||||
(new-object System.Net.WebClient).DownloadFile(
|
||||
'https://services.gradle.org/distributions/gradle-5.6.4-bin.zip',
|
||||
'https://services.gradle.org/distributions/gradle-5.3.1-bin.zip',
|
||||
'C:\gradle-bin.zip'
|
||||
)
|
||||
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\gradle-bin.zip", "C:\gradle")
|
||||
}
|
||||
- cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;C:\gradle\gradle-5.6.4\bin;%JAVA_HOME%\bin;%PATH%
|
||||
- cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;C:\gradle\gradle-5.3.1\bin;%JAVA_HOME%\bin;%PATH%
|
||||
- cmd: SET MAVEN_OPTS=-Xmx4g
|
||||
- cmd: SET JAVA_OPTS=-Xmx4g
|
||||
- cmd: SET M2_HOME=C:\maven\apache-maven-3.2.5
|
||||
@@ -32,22 +32,12 @@ install:
|
||||
- git clone https://github.com/wing328/swagger-samples
|
||||
- ps: Start-Process -FilePath 'C:\maven\apache-maven-3.2.5\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci"
|
||||
- ps: $PSVersionTable.PSVersion
|
||||
- ps: Install-Module Pester -Force -Scope CurrentUser
|
||||
- ps: Install-Module Pester -Force -Scope CurrentUser -RequiredVersion 4.3.1
|
||||
build_script:
|
||||
- dotnet --info
|
||||
# build C# aspnetcore 3.1 server
|
||||
- dotnet build samples\server\petstore\aspnetcore-3.1\Org.OpenAPITools.sln
|
||||
# build C# aspnetcore 3.0 server
|
||||
- dotnet build samples\server\petstore\aspnetcore-3.0\Org.OpenAPITools.sln
|
||||
# build C# aspnetcore 2.2 server
|
||||
- dotnet build samples\server\petstore\aspnetcore\Org.OpenAPITools.sln
|
||||
# build C# API client (netcore)
|
||||
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient\Org.OpenAPITools.sln
|
||||
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClientCore\Org.OpenAPITools.sln
|
||||
# build C# API client (.net framework 4.7)
|
||||
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-net47\Org.OpenAPITools.sln
|
||||
# build C# API client (.net 5.0)
|
||||
- dotnet build samples\client\petstore\csharp-netcore\OpenAPIClient-net5.0\Org.OpenAPITools.sln
|
||||
# build C# API client
|
||||
- nuget restore samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln
|
||||
- msbuild samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
@@ -55,31 +45,28 @@ build_script:
|
||||
- nuget restore samples\client\petstore\csharp\OpenAPIClientWithPropertyChanged\Org.OpenAPITools.sln
|
||||
- msbuild samples\client\petstore\csharp\OpenAPIClientWithPropertyChanged\Org.OpenAPITools.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
# build C# .net standard 1.3+ API client
|
||||
#- nuget restore samples\client\petstore\csharp\OpenAPIClientNetStandard\Org.OpenAPITools.sln
|
||||
#- msbuild samples\client\petstore\csharp\OpenAPIClientNetStandard\Org.OpenAPITools.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
- nuget restore samples\client\petstore\csharp\OpenAPIClientNetStandard\Org.OpenAPITools.sln
|
||||
- msbuild samples\client\petstore\csharp\OpenAPIClientNetStandard\Org.OpenAPITools.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
# install openapi-generator locally
|
||||
- mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
|
||||
# run the locally installed openapi-generator-gradle-plugin
|
||||
- gradle -b modules\openapi-generator-gradle-plugin\samples\local-spec\build.gradle buildGoSdk --stacktrace
|
||||
test_script:
|
||||
# restore test-related files
|
||||
- copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test c# API client (netcore)
|
||||
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test C# API client (.net framework 4.7)
|
||||
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-net47\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test C# API client (.net 5.0)
|
||||
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClient-net5.0\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
- dotnet test samples\client\petstore\csharp-netcore\OpenAPIClientCore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test c# API client
|
||||
- nunit3-console samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor
|
||||
# test c# API client (with PropertyChanged)
|
||||
- nunit3-console samples\client\petstore\csharp\OpenAPIClientWithPropertyChanged\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor
|
||||
|
||||
### TODO: Execute all generators via powershell or other
|
||||
# generate all petstore clients
|
||||
# - .\bin\windows\run-all-petstore.cmd
|
||||
# generate all petstore clients (openapi3)
|
||||
# - .\bin\openapi3\windows\run-all-petstore.cmd
|
||||
- .\bin\windows\run-all-petstore.cmd
|
||||
|
||||
# generate all petstore clients (openapi3)
|
||||
- .\bin\openapi3\windows\run-all-petstore.cmd
|
||||
# test ps pestore
|
||||
- ps: |
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
36
bin/ada-petstore.sh
Executable file
36
bin/ada-petstore.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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"
|
||||
model="modules/openapi-generator/src/test/resources/2_0/petstore.yaml"
|
||||
ags="generate --template-dir modules/openapi-generator/src/main/resources/Ada -g ada $@"
|
||||
ags="$ags -i $model -t modules/openapi-generator/src/main/resources/Ada -o samples/client/petstore/ada"
|
||||
ags="$ags --additional-properties projectName=Petstore --model-package Samples.Petstore"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
rm -rf samples/client/petstore/ada/src/server
|
||||
5
bin/android-petstore-all.sh
Executable file
5
bin/android-petstore-all.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
./bin/android-petstore-httpclient.sh
|
||||
./bin/android-petstore-volley.sh
|
||||
|
||||
32
bin/android-petstore-httpclient.sh
Executable file
32
bin/android-petstore-httpclient.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/android -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g android --additional-properties library=httpclient -o samples/client/petstore/android/httpclient $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
4
bin/android-petstore-volley.json
Normal file
4
bin/android-petstore-volley.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"library": "volley",
|
||||
"artifactId": "petstore-android-volley"
|
||||
}
|
||||
32
bin/android-petstore-volley.sh
Executable file
32
bin/android-petstore-volley.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g android -c bin/android-petstore-volley.json -o samples/client/petstore/android/volley $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/apache2-petstore-config.sh
Executable file
32
bin/apache2-petstore-config.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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 -g apache2 -t modules/openapi-generator/src/main/resources/apache2/ -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o samples/config/petstore/apache2 $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/apex-petstore.sh
Executable file
32
bin/apex-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/apex -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g apex -o samples/client/petstore/apex --global-property skipFormModel=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
31
bin/asciidoc-documentation-petstore.sh
Executable file
31
bin/asciidoc-documentation-petstore.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=$(ls -ld "$SCRIPT")
|
||||
link=$(expr "$ls" : '.*-> \(.*\)$')
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=$(dirname "$SCRIPT")/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=$(dirname "$SCRIPT")/..
|
||||
APP_DIR=$(cd "${APP_DIR}"; pwd)
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/asciidoc-documentation --additional-properties=specDir=modules/openapi-generator/src/main/resources/asciidoc-documentation,snippetDir=. -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g asciidoc -o samples/documentation/asciidoc $@"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
||||
32
bin/aspnetcore-petstore-server-3.0.sh
Executable file
32
bin/aspnetcore-petstore-server-3.0.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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 -g aspnetcore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/aspnetcore/3.0/ -o samples/server/petstore/aspnetcore-3.0 --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} --additional-properties aspnetCoreVersion=3.0 $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/aspnetcore-petstore-server-3.1.sh
Executable file
32
bin/aspnetcore-petstore-server-3.1.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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 -g aspnetcore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/aspnetcore/3.0/ -o samples/server/petstore/aspnetcore-3.1 --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} --additional-properties aspnetCoreVersion=3.1 $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/aspnetcore-petstore-server.sh
Executable file
32
bin/aspnetcore-petstore-server.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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 -g aspnetcore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/aspnetcore/2.1/ -o samples/server/petstore/aspnetcore --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/aspnetcore3-petstore-server.sh
Normal file
32
bin/aspnetcore3-petstore-server.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
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 -g aspnetcore -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/aspnetcore/3.0/ -o samples/server/petstore/aspnetcore3 --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} --additional-properties aspnetCoreVersion=3.0 $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/avro-petstore.sh
Executable file
32
bin/avro-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/avro-schema -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g avro-schema -o samples/openapi3/schema/petstore/avro-schema $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
32
bin/bash-petstore.sh
Executable file
32
bin/bash-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
args="generate -t modules/openapi-generator/src/main/resources/bash -i modules/openapi-generator/src/test/resources/2_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 $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $args
|
||||
32
bin/c-petstore.sh
Executable file
32
bin/c-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/C-libcurl -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g c -o samples/client/petstore/c $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
6
bin/ci/apex-petstore.json
Normal file
6
bin/ci/apex-petstore.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"generatorName": "apex",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml",
|
||||
"outputDir": "samples/client/petstore/apex",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/apex"
|
||||
}
|
||||
11
bin/ci/csharp-netcore-petstore-1.json
Normal file
11
bin/ci/csharp-netcore-petstore-1.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"generatorName": "csharp-netcore",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/csharp-netcore/OpenAPIClientCore",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/csharp-netcore/",
|
||||
"additionalProperties": {
|
||||
"packageGuid": "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}",
|
||||
"useCompareNetObjects": true,
|
||||
"targetFramework": "netcoreapp2.0"
|
||||
}
|
||||
}
|
||||
10
bin/ci/csharp-netcore-petstore.json
Normal file
10
bin/ci/csharp-netcore-petstore.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"generatorName": "csharp-netcore",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/csharp-netcore/OpenAPIClient",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/csharp-netcore/",
|
||||
"additionalProperties": {
|
||||
"packageGuid": "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}",
|
||||
"useCompareNetObjects": true
|
||||
}
|
||||
}
|
||||
8
bin/ci/csharp-petstore.json
Normal file
8
bin/ci/csharp-petstore.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"generatorName": "csharp",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml",
|
||||
"outputDir": "samples/client/petstore/csharp/OpenAPIClient",
|
||||
"additionalProperties": {
|
||||
"packageGuid": "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}"
|
||||
}
|
||||
}
|
||||
11
bin/ci/dart-flutter-petstore.json
Normal file
11
bin/ci/dart-flutter-petstore.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"generatorName": "dart",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml",
|
||||
"outputDir": "samples/client/petstore/dart/flutter_petstore/openapi",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/dart",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true,
|
||||
"browserClient": false,
|
||||
"supportDart2": false
|
||||
}
|
||||
}
|
||||
10
bin/ci/dart-jaguar-petstore-1.json
Normal file
10
bin/ci/dart-jaguar-petstore-1.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"generatorName": "dart-jaguar",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml",
|
||||
"outputDir": "samples/client/petstore/dart-jaguar/flutter_petstore/openapi",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true,
|
||||
"pubName": "openapi"
|
||||
}
|
||||
}
|
||||
11
bin/ci/dart-jaguar-petstore-2.json
Normal file
11
bin/ci/dart-jaguar-petstore-2.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"generatorName": "dart-jaguar",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml",
|
||||
"outputDir": "samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar",
|
||||
"additionalProperties": {
|
||||
"serialization": "proto",
|
||||
"hideGenerationTimestamp": true,
|
||||
"pubName": "openapi"
|
||||
}
|
||||
}
|
||||
11
bin/ci/dart-jaguar-petstore-3.json
Normal file
11
bin/ci/dart-jaguar-petstore-3.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"generatorName": "dart-jaguar",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore-proto.yaml",
|
||||
"outputDir": "samples/client/petstore/dart-jaguar/openapi_proto",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar",
|
||||
"additionalProperties": {
|
||||
"serialization": "proto",
|
||||
"hideGenerationTimestamp": true,
|
||||
"pubName": "openapi"
|
||||
}
|
||||
}
|
||||
10
bin/ci/dart-jaguar-petstore.json
Normal file
10
bin/ci/dart-jaguar-petstore.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"generatorName": "dart-jaguar",
|
||||
"inputSpec": "modules/openapi-generator/src/test/resources/2_0/petstore.yaml",
|
||||
"outputDir": "samples/client/petstore/dart-jaguar/openapi",
|
||||
"templateDir": "modules/openapi-generator/src/main/resources/dart-jaguar",
|
||||
"additionalProperties": {
|
||||
"hideGenerationTimestamp": true,
|
||||
"pubName": "openapi"
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user