Skip to content

Commit

Permalink
Merge branch 'master' into path-handling
Browse files Browse the repository at this point in the history
* master: (27 commits)
  [WIP][python-exp] Force camelization of imports (#7186)
  Fixes #6942: Added ability to prepend a basePath to typescript-redux-query generators (#6943)
  [Typescript] Import path is invalid in windows. (#7175)
  Fix JaxRS Spec generator additional model types (#7180)
  [python{,-experimental}] Obey floating point timeouts provided to RESTClientObject.request(...) (#7154)
  [C#] Switch the spec to OAS v3 from v2 (#7176)
  [Javascript] Fixing the handling of non primitive types in paramToString (#7171) (#7172)
  [typescript-node] Fix invalid type when using node@10 and ES5 (#7133)
  Minor fix to github workflow badge
  [gradle] Enabling up-to-date checks and gradle caching for openapigenerator tasks (#6716)
  feat(csharp-netcore): Adding response headers to the ApiException (#7169)
  [ci] Verify supported JDK versions on master push (#7085)
  Issue #6830: Java server - Add getter to ApiException templates (#7150)
  update kotlin samples
  [Kotlin] Make ApiClient in jvm-retrofit2 be able to use own OkHttpClient (#6999)
  Sttp - wrap query params (#6884)
  Add a link to https://medium.com/@everisBrasil blog post (#7160)
  [C#][netcore] fix regular expression when it contains double quotes (#7147)
  remove duplicated cancellationToken in comment (#7148)
  update samples
  ...
  • Loading branch information
jimschubert committed Aug 12, 2020
2 parents f3db22c + f609120 commit 4c9b64f
Show file tree
Hide file tree
Showing 922 changed files with 4,878 additions and 99,941 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/check-supported-versions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Check Supported Java Versions
on:
push:
branches:
- master

jobs:
build:
name: Build on JDK ${{ matrix.java }} and ${{ 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: Test gradle
shell: bash
run: gradle -b modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle buildGoSdk --stacktrace

- name: Upload Maven build artifact
uses: actions/upload-artifact@v1
if: matrix.java == '8'
with:
name: artifact
path: modules/openapi-generator-cli/target/openapi-generator-cli.jar

verify:
name: Verifies integrity of the commit on ${{ matrix.os }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
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
run: |
mkdir -p modules/openapi-generator-cli/target/
mv artifact/openapi-generator-cli.jar modules/openapi-generator-cli/target/
./bin/utils/ensure-up-to-date
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/master)](https://cloud.drone.io/OpenAPITools/openapi-generator)
[![iOS Build Status](https://app.bitrise.io/app/4a2b10a819d12b67/status.svg?token=859FMDR8QHwabCzwvZK6vQ&branch=master)](https://app.bitrise.io/app/4a2b10a819d12b67)
![Check Supported Java Versions](https://github.com/openapitools/openapi-generator/workflows/Check%20Supported%20Java%20Versions/badge.svg)

</div>

Expand Down Expand Up @@ -767,6 +768,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- 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-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)

## [6 - About Us](#table-of-contents)

Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ install:
# install gradle
- ps: |
Add-Type -AssemblyName System.IO.Compression.FileSystem
if (!(Test-Path -Path "C:\gradle" )) {
if (!(Test-Path -Path "C:\gradle\gradle-5.6.4" )) {
(new-object System.Net.WebClient).DownloadFile(
'https://services.gradle.org/distributions/gradle-5.3.1-bin.zip',
'https://services.gradle.org/distributions/gradle-5.6.4-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.3.1\bin;%JAVA_HOME%\bin;%PATH%
- cmd: SET PATH=C:\maven\apache-maven-3.2.5\bin;C:\gradle\gradle-5.6.4\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
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/csharp-OpenAPIClient.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
generatorName: csharp
outputDir: samples/client/petstore/csharp/OpenAPIClient
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
2 changes: 1 addition & 1 deletion bin/configs/csharp-netcore-OpenAPIClient.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generatorName: csharp-netcore
outputDir: samples/client/petstore/csharp-netcore/OpenAPIClient
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp-netcore
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
Expand Down
2 changes: 1 addition & 1 deletion bin/configs/csharp-netcore-OpenAPIClientCore.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
generatorName: csharp-netcore
outputDir: samples/client/petstore/csharp-netcore/OpenAPIClientCore
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/csharp-netcore
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
Expand Down
1 change: 1 addition & 0 deletions docs/generators/go-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sidebar_label: go-server

| Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- |
|enumClassPrefix|Prefix enum with class name| |false|
|featureCORS|Enable Cross-Origin Resource Sharing middleware| |false|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|packageName|Go package name (convention: lowercase).| |openapi|
Expand Down
29 changes: 29 additions & 0 deletions modules/openapi-generator-gradle-plugin/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,35 @@ task validateBadSpec(type: org.openapitools.generator.gradle.plugin.tasks.Valida
task validateSpecs(dependsOn: ['validateGoodSpec', 'validateBadSpec'])
----

[NOTE]
====
The tasks support Gradle Up-To-Date checking and Gradle Cache. Enable caching globally by setting `org.gradle.caching=true` in the `gradle.settings`
file or by passing the command line property `--build-cache` when executing on the command line.
Disable up-to-date checks and caching by setting the following property when using the extension:
.Disable caching for extension
[source,groovy]
----
tasks.withType(org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
outputs.upToDateWhen { false }
outputs.cacheIf { false }
}
----
Disable up-to-date checks and caching for a custom task:
.Disable caching for custom task
[source,groovy]
----
task validateGoodSpec(type: org.openapitools.generator.gradle.plugin.tasks.ValidateTask){
outputs.upToDateWhen { false }
outputs.cacheIf { false }
inputSpec = "$rootDir/petstore-v3.0.yaml".toString()
}
----
====

== Plugin Setup

//# RELEASE_VERSION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Thu Jan 30 22:14:34 EST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Local Spec Sample

This example assumes you have Gradle 4.7+ installed. No gradle wrapper is provided in samples.
This example assumes you have Gradle 5.6.4+ installed. No gradle wrapper is provided in samples.

First, publish the openapi-generator-gradle-plugin locally via `./gradlew assemble install` in the module directory.
First, publish the openapi-generator-gradle-plugin locally via `./gradlew assemble publishToMavenLocal` in the module directory.

Then, run the following tasks in this example directory.

```bash
gradle openApiGenerate
gradle openApiMeta
gradle openApiValidate
gradle buildGoSdk
gradle buildDotnetSdk
gradle generateGoWithInvalidSpec
gradle openApiGenerate # expected outcome: BUILD SCCESSFUL
gradle openApiMeta # expected outcome: BUILD SCCESSFUL
gradle openApiValidate # expected outcome: BUILD FAILED
gradle buildGoSdk # expected outcome: BUILD SCCESSFUL
gradle buildDotnetSdk # expected outcome: BUILD SCCESSFUL
gradle generateGoWithInvalidSpec # expected outcome: BUILD FAILED
```

The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ class OpenApiGeneratorPlugin : Plugin<Project> {
)

val generators = extensions.create(
"openApiGenerators",
OpenApiGeneratorGeneratorsExtension::class.java,
project
"openApiGenerators",
OpenApiGeneratorGeneratorsExtension::class.java,
project
)

generate.outputDir.set("$buildDir/generate-resources/main")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
}

@Suppress("MemberVisibilityCanBePrivate")
fun applyDefaults(){
fun applyDefaults() {
releaseNote.set("Minor update")
modelNamePrefix.set("")
modelNameSuffix.set("")
Expand Down
Loading

0 comments on commit 4c9b64f

Please sign in to comment.