-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix duplicated operationId with new rule in normalizer (#19872)
* fix duplicated opeationId with new rule in normalizer * update workflow * update samples * update samples * update java samples
- Loading branch information
Showing
54 changed files
with
5,806 additions
and
0 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
12 changes: 12 additions & 0 deletions
12
bin/configs/java-okhttp-gson-3.1-duplicated-operationid.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,12 @@ | ||
generatorName: java | ||
outputDir: samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid | ||
library: okhttp-gson | ||
inputSpec: modules/openapi-generator/src/test/resources/3_1/java/duplicated_operationid.yaml | ||
templateDir: modules/openapi-generator/src/main/resources/Java | ||
validateSpec: false | ||
additionalProperties: | ||
artifactId: petstore-okhttp-gson-31-do | ||
hideGenerationTimestamp: "true" | ||
disallowAdditionalPropertiesIfNotPresent: false | ||
openapiNormalizer: | ||
FIX_DUPLICATED_OPERATIONID: 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
85 changes: 85 additions & 0 deletions
85
modules/openapi-generator/src/test/resources/3_1/java/duplicated_operationid.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,85 @@ | ||
openapi: 3.1.0 | ||
servers: | ||
- url: 'http://petstore.swagger.io/v2' | ||
info: | ||
description: >- | ||
This is a sample server Petstore server. For this sample, you can use the api key | ||
`special-key` to test the authorization filters. | ||
version: 1.0.0 | ||
title: OpenAPI Petstore | ||
license: | ||
name: Apache-2.0 | ||
url: 'https://www.apache.org/licenses/LICENSE-2.0.html' | ||
tags: | ||
- name: pet | ||
description: Everything about your Pets | ||
- name: store | ||
description: Access to Petstore orders | ||
- name: user | ||
description: Operations about user | ||
paths: | ||
'/pet/{petId}': | ||
get: | ||
tags: | ||
- pet | ||
summary: Find pet by ID | ||
description: Returns a single pet | ||
operationId: getPetById | ||
parameters: | ||
- name: petId | ||
in: path | ||
description: ID of pet to return | ||
required: true | ||
schema: | ||
type: integer | ||
format: int64 | ||
responses: | ||
'200': | ||
description: successful operation | ||
content: | ||
application/xml: | ||
schema: | ||
$ref: '#/components/schemas/myObject' | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/myObject' | ||
'400': | ||
description: Invalid ID supplied | ||
'404': | ||
description: Pet not found | ||
security: | ||
- api_key: [] | ||
"/fake/duplicated/operationId": | ||
get: | ||
tags: | ||
- fake | ||
operationId: getPetById | ||
responses: | ||
'200': | ||
description: '' | ||
content: | ||
application/json: | ||
schema: | ||
anyOf: | ||
- type: 'null' | ||
- "$ref": "#/components/schemas/myObject" | ||
externalDocs: | ||
description: Find out more about Swagger | ||
url: 'http://swagger.io' | ||
components: | ||
securitySchemes: | ||
petstore_auth: | ||
type: oauth2 | ||
flows: | ||
implicit: | ||
authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' | ||
scopes: | ||
'write:pets': modify pets in your account | ||
'read:pets': read your pets | ||
api_key: | ||
type: apiKey | ||
name: api_key | ||
in: header | ||
schemas: | ||
myObject: | ||
type: object |
30 changes: 30 additions & 0 deletions
30
...s/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/.github/workflows/maven.yml
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,30 @@ | ||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
# | ||
# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech) | ||
|
||
name: Java CI with Maven | ||
|
||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
|
||
jobs: | ||
build: | ||
name: Build OpenAPI Petstore | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [ 17, 21 ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Build with Maven | ||
run: mvn -B package --no-transfer-progress --file pom.xml |
21 changes: 21 additions & 0 deletions
21
samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/.gitignore
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,21 @@ | ||
*.class | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
|
||
# exclude jar for gradle wrapper | ||
!gradle/wrapper/*.jar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
# build files | ||
**/target | ||
target | ||
.gradle | ||
build |
23 changes: 23 additions & 0 deletions
23
...les/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/.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 |
42 changes: 42 additions & 0 deletions
42
samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/.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,42 @@ | ||
.github/workflows/maven.yml | ||
.gitignore | ||
.travis.yml | ||
README.md | ||
api/openapi.yaml | ||
build.gradle | ||
build.sbt | ||
docs/FakeApi.md | ||
docs/PetApi.md | ||
git_push.sh | ||
gradle.properties | ||
gradle/wrapper/gradle-wrapper.jar | ||
gradle/wrapper/gradle-wrapper.properties | ||
gradlew | ||
gradlew.bat | ||
pom.xml | ||
settings.gradle | ||
src/main/AndroidManifest.xml | ||
src/main/java/org/openapitools/client/ApiCallback.java | ||
src/main/java/org/openapitools/client/ApiClient.java | ||
src/main/java/org/openapitools/client/ApiException.java | ||
src/main/java/org/openapitools/client/ApiResponse.java | ||
src/main/java/org/openapitools/client/Configuration.java | ||
src/main/java/org/openapitools/client/GzipRequestInterceptor.java | ||
src/main/java/org/openapitools/client/JSON.java | ||
src/main/java/org/openapitools/client/Pair.java | ||
src/main/java/org/openapitools/client/ProgressRequestBody.java | ||
src/main/java/org/openapitools/client/ProgressResponseBody.java | ||
src/main/java/org/openapitools/client/ServerConfiguration.java | ||
src/main/java/org/openapitools/client/ServerVariable.java | ||
src/main/java/org/openapitools/client/StringUtil.java | ||
src/main/java/org/openapitools/client/api/FakeApi.java | ||
src/main/java/org/openapitools/client/api/PetApi.java | ||
src/main/java/org/openapitools/client/auth/ApiKeyAuth.java | ||
src/main/java/org/openapitools/client/auth/Authentication.java | ||
src/main/java/org/openapitools/client/auth/HttpBasicAuth.java | ||
src/main/java/org/openapitools/client/auth/HttpBearerAuth.java | ||
src/main/java/org/openapitools/client/auth/OAuth.java | ||
src/main/java/org/openapitools/client/auth/OAuthFlow.java | ||
src/main/java/org/openapitools/client/auth/OAuthOkHttpClient.java | ||
src/main/java/org/openapitools/client/auth/RetryingOAuth.java | ||
src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java |
1 change: 1 addition & 0 deletions
1
...es/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/.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.10.0-SNAPSHOT |
22 changes: 22 additions & 0 deletions
22
samples/client/petstore/java/okhttp-gson-3.1-duplicated-operationid/.travis.yml
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,22 @@ | ||
# | ||
# Generated by OpenAPI Generator: https://openapi-generator.tech | ||
# | ||
# Ref: https://docs.travis-ci.com/user/languages/java/ | ||
# | ||
language: java | ||
jdk: | ||
- openjdk12 | ||
- openjdk11 | ||
- openjdk10 | ||
- openjdk9 | ||
- openjdk8 | ||
before_install: | ||
# ensure gradlew has proper permission | ||
- chmod a+x ./gradlew | ||
script: | ||
# test using maven | ||
#- mvn test | ||
# test using gradle | ||
- gradle test | ||
# test using sbt | ||
# - sbt test |
Oops, something went wrong.