-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compile error in client properties configuration (#18232)
* Fix config * Add tests * Remove unused import * Sort imports * Add new workflow
- Loading branch information
Showing
24 changed files
with
484 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
generatorName: spring | ||
outputDir: samples/client/petstore/spring-cloud-auth | ||
library: spring-cloud | ||
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-auth.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/JavaSpring | ||
additionalProperties: | ||
documentationProvider: none | ||
artifactId: petstore-spring-cloud-auth | ||
hideGenerationTimestamp: "true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
modules/openapi-generator/src/test/resources/3_0/issue_18090.yaml
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
modules/openapi-generator/src/test/resources/3_0/spring/petstore-auth.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
openapi: "3.0.3" | ||
info: | ||
description: 'This spec is mainly for testing Petstore server and contains fake | ||
endpoints, models. Please do not use this for any other purpose. Special | ||
characters: " \' | ||
version: 1.0.0 | ||
title: OpenAPI Petstore Auth | ||
license: | ||
name: Apache-2.0 | ||
url: https://www.apache.org/licenses/LICENSE-2.0.html | ||
|
||
security: | ||
- OAuth2: [openid, profile, aud] | ||
|
||
paths: | ||
/some/endpoint: | ||
get: | ||
responses: | ||
"200": | ||
description: OK | ||
|
||
components: | ||
securitySchemes: | ||
OAuth2: | ||
type: oauth2 | ||
x-tokenName: id_token | ||
flows: | ||
authorizationCode: | ||
authorizationUrl: "${authorizationUrl}" | ||
tokenUrl: "${tokenUrl}" | ||
scopes: | ||
openid: Access OpenId Connect info | ||
profile: Profile info | ||
aud: Audience info | ||
clientCredentials: | ||
tokenUrl: '/openid-connect/token' | ||
scopes: { } |
23 changes: 23 additions & 0 deletions
23
samples/client/petstore/spring-cloud-auth/.openapi-generator-ignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# OpenAPI Generator Ignore | ||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
7 changes: 7 additions & 0 deletions
7
samples/client/petstore/spring-cloud-auth/.openapi-generator/FILES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
README.md | ||
pom.xml | ||
src/main/java/org/openapitools/api/SomeApi.java | ||
src/main/java/org/openapitools/api/SomeApiClient.java | ||
src/main/java/org/openapitools/configuration/ApiKeyRequestInterceptor.java | ||
src/main/java/org/openapitools/configuration/ClientConfiguration.java | ||
src/main/java/org/openapitools/configuration/ClientPropertiesConfiguration.java |
1 change: 1 addition & 0 deletions
1
samples/client/petstore/spring-cloud-auth/.openapi-generator/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.5.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# petstore-spring-cloud-auth | ||
|
||
## Requirements | ||
|
||
Building the API client library requires [Maven](https://maven.apache.org/) to be installed. | ||
|
||
## Installation | ||
|
||
To install the API client library to your local Maven repository, simply execute: | ||
|
||
```shell | ||
mvn install | ||
``` | ||
|
||
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: | ||
|
||
```shell | ||
mvn deploy | ||
``` | ||
|
||
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. | ||
|
||
### Maven users | ||
|
||
Add this dependency to your project's POM: | ||
|
||
```xml | ||
<dependency> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>petstore-spring-cloud-auth</artifactId> | ||
<version>1.0.0</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
``` | ||
|
||
### Gradle users | ||
|
||
Add this dependency to your project's build file: | ||
|
||
```groovy | ||
compile "org.openapitools:petstore-spring-cloud-auth:1.0.0" | ||
``` | ||
|
||
### Others | ||
|
||
At first generate the JAR by executing: | ||
|
||
mvn package | ||
|
||
Then manually install the following JARs: | ||
|
||
* target/petstore-spring-cloud-auth-1.0.0.jar | ||
* target/lib/*.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>petstore-spring-cloud-auth</artifactId> | ||
<packaging>jar</packaging> | ||
<name>petstore-spring-cloud-auth</name> | ||
<version>1.0.0</version> | ||
<properties> | ||
<java.version>1.8</java.version> | ||
<maven.compiler.source>${java.version}</maven.compiler.source> | ||
<maven.compiler.target>${java.version}</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.7.15</version> | ||
<relativePath/> <!-- lookup parent from repository --> | ||
</parent> | ||
<build> | ||
<sourceDirectory>src/main/java</sourceDirectory> | ||
</build> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-parent</artifactId> | ||
<version>2021.0.5</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<!-- @Nullable annotation --> | ||
<dependency> | ||
<groupId>com.google.code.findbugs</groupId> | ||
<artifactId>jsr305</artifactId> | ||
<version>3.0.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-openfeign</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.security</groupId> | ||
<artifactId>spring-security-oauth2-client</artifactId> | ||
<version>5.7.8</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.datatype</groupId> | ||
<artifactId>jackson-datatype-jsr310</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>jackson-databind-nullable</artifactId> | ||
<version>0.2.6</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-validation</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.data</groupId> | ||
<artifactId>spring-data-commons</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Oops, something went wrong.