Skip to content

Commit

Permalink
Merge pull request #23 from OpenAPITools/master
Browse files Browse the repository at this point in the history
merge master
  • Loading branch information
bflamand authored Sep 17, 2021
2 parents b2bfad9 + fdb13c3 commit d593421
Show file tree
Hide file tree
Showing 10,023 changed files with 415,360 additions and 80,744 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
machine:
image: circleci/classic:latest
working_directory: ~/OpenAPITools/openapi-generator
parallelism: 3
parallelism: 4
shell: /bin/bash --login
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
Expand Down Expand Up @@ -82,7 +82,6 @@ jobs:
- ~/.bundle
- ~/.go_workspace
- ~/.gradle
- ~/.pub-cache
- ~/.cache/bower
- ".git"
- ~/.stack
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/*.mustache linguist-vendored=true
* text=auto eol=lf
10 changes: 5 additions & 5 deletions .github/.test/js-yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ function readBlockScalar(state, nodeIndent) {
}
}

// Break this `while` cycle and go to the funciton's epilogue.
// Break this `while` cycle and go to the function's epilogue.
break;
}

Expand Down Expand Up @@ -2862,7 +2862,7 @@ module.exports = new Schema({
//
// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
// So, this schema is not such strict as defined in the YAML specification.
// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
// It allows numbers in binary notation, use `Null` and `NULL` as `null`, etc.


'use strict';
Expand Down Expand Up @@ -3222,7 +3222,7 @@ function representYamlFloat(object, style) {
res = object.toString(10);

// JS stringifier can build scientific format without dots: 5e-100,
// while YAML requres dot: 5.e-100. Fix it with simple hack
// while YAML requires dot: 5.e-100. Fix it with simple hack

return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
}
Expand Down Expand Up @@ -3424,7 +3424,7 @@ var esprima;
// Browserified version does not have esprima
//
// 1. For node.js just require module as deps
// 2. For browser try to require mudule via external AMD system.
// 2. For browser try to require module via external AMD system.
// If not found - try to fallback to window.esprima. If not
// found too - then fail to parse.
//
Expand Down Expand Up @@ -3881,7 +3881,7 @@ function constructYamlTimestamp(data) {
if (match[9]) {
tz_hour = +(match[10]);
tz_minute = +(match[11] || 0);
delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
delta = (tz_hour * 60 + tz_minute) * 60000; // delta in milliseconds
if (match[9] === '-') delta = -delta;
}

Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ scripts/**/* @jimschubert
website/**/* @jimschubert
bin/ci/**/* @jimschubert

## Bulid related
## Build related
CI/**/* @OpenAPITools/build
.mvn/**/* @OpenAPITools/build
bin/utils/**/* @OpenAPITools/build
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
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`
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (5.3.0), `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.
19 changes: 19 additions & 0 deletions .github/actions/run-samples/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Run samples'
description: 'Runs sample integration test profile with Maven'
inputs:
name:
description: 'The Maven profile name'
required: true
goal:
description: 'Maven goal'
required: false
default: 'verify'
args:
description: 'Additional maven arguments'
required: false
default: ''
runs:
using: "composite"
steps:
- run: mvn --no-snapshot-updates --batch-mode --quiet ${{ inputs.goal }} -P${{ inputs.name }} -Dintegration-test -Dmaven.javadoc.skip=true ${{ inputs.args }}
shell: bash
17 changes: 9 additions & 8 deletions .github/workflows/check-supported-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,19 @@ jobs:
uses: actions/checkout@v2

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: ${{ matrix.java }}

- uses: actions/[email protected].4
- uses: actions/[email protected].6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/[email protected].4
- uses: actions/[email protected].6
with:
path: |
~/.gradle/caches
Expand All @@ -49,7 +50,7 @@ jobs:
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/[email protected].2
uses: actions/[email protected].4
if: matrix.java == '8' && matrix.os == 'ubuntu-latest'
with:
name: artifact
Expand Down Expand Up @@ -80,7 +81,7 @@ jobs:
- name: Check out code
uses: actions/checkout@v2
- name: Download build artifact
uses: actions/[email protected].8
uses: actions/[email protected].10
with:
name: artifact
- name: Run Ensures Script
Expand All @@ -89,6 +90,6 @@ jobs:
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 }}
mvn clean package -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
# test with java (jersey2) client generation only as ensure-uptodate script is run in another job instead
./bin/generate-samples.sh ./bin/configs/java-jersey2-8.yaml
2 changes: 1 addition & 1 deletion .github/workflows/docker-tag-latest-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# This action will "unshallow" so we have all tag info
- name: Get latest tag
id: tagger
uses: jimschubert/query-tag-action@v1
uses: jimschubert/query-tag-action@v2
with:
include: 'v*'
exclude: '*-rc*'
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/openapi-generator-test-results.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: OpenAPI Generator Test Report

on:
workflow_run:
workflows: ['OpenAPI Generator']
types:
- completed

# separate workflow required due to https://github.com/dorny/test-reporter#recommended-setup-for-public-repositories
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1
with:
artifact: surefire-test-results
name: JUnit Test results
path: '**/surefire-reports/TEST-*.xml'
reporter: java-junit
214 changes: 214 additions & 0 deletions .github/workflows/openapi-generator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
name: OpenAPI Generator

on:
push:
branches:
- master
- '[5-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[5-9]+.[0-9]+.x'

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache maven dependencies
uses: actions/[email protected]
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Run maven
run: mvn --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error
- run: ls -la modules/openapi-generator-cli/target
- name: Upload openapi-generator-cli.jar artifact
uses: actions/[email protected]
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar
retention-days: 1

test:
name: Unit tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache maven dependencies
uses: actions/[email protected]
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
- name: Run unit tests
run: mvn --no-snapshot-updates --batch-mode --quiet --fail-at-end test -Dorg.slf4j.simpleLogger.defaultLogLevel=error
- name: Publish unit test reports
if: ${{ always() }}
uses: actions/[email protected]
with:
name: surefire-test-results
path: '**/surefire-reports/TEST-*.xml'

documentation:
name: Docs up-to-date
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Download openapi-generator-cli.jar artifact
uses: actions/[email protected]
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target
- name: Generate docs
run: |
bash bin/meta-codegen.sh
bash bin/utils/export_docs_generators.sh
bash bin/utils/copy-to-website.sh
bash bin/utils/export_generators_readme.sh
- name: Verify git status
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
echo "UNCOMMITTED CHANGES ERROR"
echo "There are uncommitted changes in working tree after execution of 'bin/ensure-up-to-date'"
echo "Perform git diff"
git --no-pager diff
echo "Perform git status"
git status
echo -e "\nThis script runs in pull requests against the anticipated merge commit (as if the PR was merged now)."
echo "When you see unexpected files here, it likely means that there are newer commits in master that you need to "
echo -e "rebase or merge into your branch.\n"
echo "Please run 'bin/utils/ensure-up-to-date' locally and commit changes (UNCOMMITTED CHANGES ERROR)"
exit 1
fi
samples:
name: Samples up-to-date
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Download openapi-generator-cli.jar artifact
uses: actions/[email protected]
with:
name: openapi-generator-cli.jar
path: modules/openapi-generator-cli/target
- name: Generate samples
run: bash bin/generate-samples.sh
- name: Verify git status
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
echo "UNCOMMITTED CHANGES ERROR"
echo "There are uncommitted changes in working tree after execution of 'bin/generate-samples.sh'"
echo "Perform git diff"
git --no-pager diff
echo "Perform git status"
git status
echo -e "\nThis script runs in pull requests against the anticipated merge commit (as if the PR was merged now)."
echo "When you see unexpected files here, it likely means that there are newer commits in master that you need to "
echo -e "rebase or merge into your branch.\n"
echo "Please run 'bin/generate-samples.sh' locally and commit changes (UNCOMMITTED CHANGES ERROR)"
exit 1
fi
test-maven-plugin:
name: Maven plugin tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache maven dependencies
uses: actions/[email protected]
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-test-maven-plugin-${{ env.cache-name }}-
${{ runner.os }}-test-maven-plugin-
- name: Run tests
run: |
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:
name: Gradle plugin tests
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache maven dependencies
uses: actions/[email protected]
env:
cache-name: cache-maven-repository
with:
path: |
~/.m2/repository
~/.gradle
!~/.gradle/caches/modules-2/modules-2.lock
!~/.gradle/caches/*/plugin-resolution/
!~/.m2/repository/org/openapitools/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-test-gradle-plugin-${{ env.cache-name }}-
${{ runner.os }}-test-gradle-plugin-
- name: Run tests
run: |
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk)
(cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate)
Loading

0 comments on commit d593421

Please sign in to comment.