From 6e42427e1d93253b1a2dee2ef915fee7c9ec10e7 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 26 Dec 2022 16:48:40 +0800 Subject: [PATCH 1/5] update openapi-generator dep --- modules/openapi-generator/pom.xml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index f9dec6200d3e..790c4a80ac2b 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -327,13 +327,11 @@ org.testng testng - ${testng.version} - test com.github.javaparser javaparser-core - 3.24.0 + 3.24.9 test @@ -356,7 +354,7 @@ org.commonmark commonmark - 0.20.0 + 0.21.0 org.mockito @@ -426,7 +424,7 @@ com.github.ben-manes.caffeine caffeine - 2.9.3 + 3.1.2 org.assertj From 10f061dd104d54ea64d69e2e1427bb4d74c1a21b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 26 Dec 2022 17:48:34 +0800 Subject: [PATCH 2/5] update dep, fix tests with new spec --- .../python/PythonLegacyClientCodegenTest.java | 2 +- .../PythonNextgenClientCodegenTest.java | 2 +- .../codegen/python/PythonPriorClientTest.java | 2 +- .../src/test/resources/3_0/v1beta3.yaml | 375 ++++++++++++++++++ pom.xml | 12 +- 5 files changed, 384 insertions(+), 9 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/v1beta3.yaml diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java index 3af8b16d51b7..28f3d68c0c58 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonLegacyClientCodegenTest.java @@ -128,7 +128,7 @@ public void testSingleQuotes() { @Test(description = "convert a python model with dots") public void modelTest() { - final OpenAPI openAPI= TestUtils.parseFlattenSpec("src/test/resources/2_0/v1beta3.json"); + final OpenAPI openAPI= TestUtils.parseFlattenSpec("src/test/resources/3_0/v1beta3.yaml"); final DefaultCodegen codegen = new PythonLegacyClientCodegen(); codegen.setOpenAPI(openAPI); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonNextgenClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonNextgenClientCodegenTest.java index 2e603685ee22..38b2f97fd45e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonNextgenClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonNextgenClientCodegenTest.java @@ -127,7 +127,7 @@ public void testSingleQuotes() { @Test(description = "convert a python model with dots") public void modelTest() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/v1beta3.json"); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/v1beta3.yaml"); final DefaultCodegen codegen = new PythonNextgenClientCodegen(); codegen.setOpenAPI(openAPI); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientTest.java index df88361a53dd..e45b037f969b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonPriorClientTest.java @@ -50,7 +50,7 @@ public class PythonPriorClientTest { @Test(description = "convert a python model with dots") public void modelTest() { - final OpenAPI openAPI= TestUtils.parseFlattenSpec("src/test/resources/2_0/v1beta3.json"); + final OpenAPI openAPI= TestUtils.parseFlattenSpec("src/test/resources/3_0/v1beta3.yaml"); final DefaultCodegen codegen = new PythonPriorClientCodegen(); codegen.setOpenAPI(openAPI); diff --git a/modules/openapi-generator/src/test/resources/3_0/v1beta3.yaml b/modules/openapi-generator/src/test/resources/3_0/v1beta3.yaml new file mode 100644 index 000000000000..512de5d79cb3 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/v1beta3.yaml @@ -0,0 +1,375 @@ +openapi: 3.0.1 +info: + version: v1beta3 +servers: +- url: https://127.0.0.1:6443/ +paths: + /api/v1beta3/namespaces/{namespaces}/bindings: + post: + operationId: createBinding + parameters: + - description: "object name and auth scope, such as for teams and projects" + in: path + name: namespaces + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/v1beta3.Binding' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/v1beta3.Binding' + description: success + summary: create a Binding + tags: + - apiv1beta3 + x-codegen-request-body-name: body + x-content-type: '*/*' + x-accepts: application/json + /api/v1beta3/namespaces/{namespaces}/componentstatuses/{name}: + get: + operationId: readComponentStatus + parameters: + - description: name of the ComponentStatus + in: path + name: name + required: true + schema: + type: string + - description: "object name and auth scope, such as for teams and projects" + in: path + name: namespaces + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/v1beta3.ComponentStatus' + description: success + summary: read the specified ComponentStatus + tags: + - apiv1beta3 + x-accepts: application/json + /api/v1beta3/namespaces/{namespaces}/componentstatuses: + get: + operationId: listComponentStatus + parameters: + - description: "object name and auth scope, such as for teams and projects" + in: path + name: namespaces + required: true + schema: + type: string + - description: a selector to restrict the list of returned objects by their + fields; defaults to everything + in: query + name: fieldSelector + schema: + type: string + - description: a selector to restrict the list of returned objects by their + labels; defaults to everything + in: query + name: labelSelector + schema: + type: string + - description: "when specified with a watch call, shows changes that occur after\ + \ that particular version of a resource; defaults to changes from the beginning\ + \ of history" + in: query + name: resourceVersion + schema: + type: string + - description: "watch for changes to the described resources and return them\ + \ as a stream of add, update, and remove notifications; specify resourceVersion" + in: query + name: watch + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/v1beta3.ComponentStatusList' + description: success + summary: list objects of kind ComponentStatus + tags: + - apiv1beta3 + x-accepts: application/json +components: + schemas: + v1beta3.ComponentStatus: + example: + metadata: + uid: uid + resourceVersion: resourceVersion + creationTimestamp: creationTimestamp + name: name + namespace: namespace + annotations: "{}" + generateName: generateName + deletionTimestamp: deletionTimestamp + labels: "{}" + selfLink: selfLink + apiVersion: apiVersion + kind: kind + conditions: + - uid: uid + apiVersion: apiVersion + kind: kind + resourceVersion: resourceVersion + fieldPath: fieldPath + name: name + namespace: namespace + - uid: uid + apiVersion: apiVersion + kind: kind + resourceVersion: resourceVersion + fieldPath: fieldPath + name: name + namespace: namespace + properties: + apiVersion: + description: version of the schema the object should have + type: string + conditions: + description: list of component conditions observed + items: + $ref: '#/components/schemas/v1beta3.ObjectReference' + type: array + kind: + description: "kind of object, in CamelCase; cannot be updated" + type: string + metadata: + $ref: '#/components/schemas/v1beta3.ObjectMeta' + type: object + v1beta3.ObjectMeta: + example: + uid: uid + resourceVersion: resourceVersion + creationTimestamp: creationTimestamp + name: name + namespace: namespace + annotations: "{}" + generateName: generateName + deletionTimestamp: deletionTimestamp + labels: "{}" + selfLink: selfLink + properties: + annotations: + description: map model with key property names to any type + type: object + creationTimestamp: + description: "RFC 3339 date and time at which the object was created; populated\ + \ by the system, read-only; null for lists" + type: string + deletionTimestamp: + description: "RFC 3339 date and time at which the object will be deleted;\ + \ populated by the system when a graceful deletion is requested, read-only;\ + \ if not set, graceful deletion of the object has not been requested" + type: string + generateName: + description: "an optional prefix to use to generate a unique name; has the\ + \ same validation rules as name; optional, and is applied only name if\ + \ is not specified" + type: string + labels: + description: map model with key property names to any type + type: object + name: + description: string that identifies an object. Must be unique within a namespace; + cannot be updated + type: string + namespace: + description: namespace of the object; cannot be updated + type: string + resourceVersion: + description: "string that identifies the internal version of this object\ + \ that can be used by clients to determine when objects have changed;\ + \ populated by the system, read-only; value must be treated as opaque\ + \ by clients and passed unmodified back to the server: http://docs.k8s.io/api-conventions.md#concurrency-control-and-consistency" + type: string + selfLink: + description: "URL for the object; populated by the system, read-only" + type: string + uid: + description: unique UUID across space and time; populated by the system; + read-only + type: string + type: object + v1beta3.ComponentStatusList: + example: + metadata: + uid: uid + resourceVersion: resourceVersion + creationTimestamp: creationTimestamp + name: name + namespace: namespace + annotations: "{}" + generateName: generateName + deletionTimestamp: deletionTimestamp + labels: "{}" + selfLink: selfLink + apiVersion: apiVersion + kind: kind + items: + - metadata: + uid: uid + resourceVersion: resourceVersion + creationTimestamp: creationTimestamp + name: name + namespace: namespace + annotations: "{}" + generateName: generateName + deletionTimestamp: deletionTimestamp + labels: "{}" + selfLink: selfLink + apiVersion: apiVersion + kind: kind + conditions: + - uid: uid + apiVersion: apiVersion + kind: kind + resourceVersion: resourceVersion + fieldPath: fieldPath + name: name + namespace: namespace + - uid: uid + apiVersion: apiVersion + kind: kind + resourceVersion: resourceVersion + fieldPath: fieldPath + name: name + namespace: namespace + - metadata: + uid: uid + resourceVersion: resourceVersion + creationTimestamp: creationTimestamp + name: name + namespace: namespace + annotations: "{}" + generateName: generateName + deletionTimestamp: deletionTimestamp + labels: "{}" + selfLink: selfLink + apiVersion: apiVersion + kind: kind + conditions: + - uid: uid + apiVersion: apiVersion + kind: kind + resourceVersion: resourceVersion + fieldPath: fieldPath + name: name + namespace: namespace + - uid: uid + apiVersion: apiVersion + kind: kind + resourceVersion: resourceVersion + fieldPath: fieldPath + name: name + namespace: namespace + properties: + apiVersion: + description: version of the schema the object should have + type: string + items: + description: list of component status objects + items: + $ref: '#/components/schemas/v1beta3.ComponentStatus' + type: array + kind: + description: "kind of object, in CamelCase; cannot be updated" + type: string + metadata: + $ref: '#/components/schemas/v1beta3.ObjectMeta' + required: + - items + type: object + v1beta3.Binding: + example: + metadata: + uid: uid + resourceVersion: resourceVersion + creationTimestamp: creationTimestamp + name: name + namespace: namespace + annotations: "{}" + generateName: generateName + deletionTimestamp: deletionTimestamp + labels: "{}" + selfLink: selfLink + apiVersion: apiVersion + kind: kind + target: + uid: uid + apiVersion: apiVersion + kind: kind + resourceVersion: resourceVersion + fieldPath: fieldPath + name: name + namespace: namespace + properties: + apiVersion: + description: version of the schema the object should have + type: string + kind: + description: "kind of object, in CamelCase; cannot be updated" + type: string + metadata: + $ref: '#/components/schemas/v1beta3.ObjectMeta' + target: + $ref: '#/components/schemas/v1beta3.ObjectReference' + required: + - target + type: object + v1beta3.ObjectReference: + example: + uid: uid + apiVersion: apiVersion + kind: kind + resourceVersion: resourceVersion + fieldPath: fieldPath + name: name + namespace: namespace + properties: + apiVersion: + description: API version of the referent + type: string + fieldPath: + description: "if referring to a piece of an object instead of an entire\ + \ object, this string should contain a valid JSON/Go field access statement,\ + \ such as desiredState.manifest.containers[2]" + type: string + kind: + description: kind of the referent + type: string + name: + description: name of the referent + type: string + namespace: + description: namespace of the referent + type: string + resourceVersion: + description: "specific resourceVersion to which this reference is made,\ + \ if any: http://docs.k8s.io/api-conventions.md#concurrency-control-and-consistency" + type: string + uid: + description: uid of the referent + type: string + type: object + any: + description: map model with key property names to any type + type: object +x-original-swagger-version: "2.0" + diff --git a/pom.xml b/pom.xml index 48ff4fd0afaf..d1da812067a3 100644 --- a/pom.xml +++ b/pom.xml @@ -1477,11 +1477,11 @@ 3.0.9 31.1-jre 4.2.1 - 2.10.0 - 2.13.4.2 - 2.13.4 + 2.12.5 + 2.14.0 + 2.14.0 0.8.7 - 1.14 + 1.15 4.13.2 1.6.10 3.10.1 @@ -1490,9 +1490,9 @@ 3.0.0 2.5.3 3.7.1 - 4.8.1 + 4.10.0 3.12.0 - 0.10 + 0.10.2 1.4 4.6.1 1.7.36 From 47bae78223180d1e2d0339d98aefbe5a8cbd57fc Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 27 Dec 2022 15:50:50 +0800 Subject: [PATCH 3/5] update kotlin version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d1da812067a3..b2b8baba7f09 100644 --- a/pom.xml +++ b/pom.xml @@ -1483,7 +1483,7 @@ 0.8.7 1.15 4.13.2 - 1.6.10 + 1.6.21 3.10.1 3.2.2 3.4.0 From 1f4c3a5d4a3660d3db201370748ec304434efe53 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 27 Dec 2022 17:01:56 +0800 Subject: [PATCH 4/5] revert cafferine version --- modules/openapi-generator/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 790c4a80ac2b..077e10556db5 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -424,7 +424,7 @@ com.github.ben-manes.caffeine caffeine - 3.1.2 + 2.9.3 org.assertj From 9aaa2a8bdf86b45b8d063ca52ddbdfbe606e7bef Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 27 Dec 2022 23:33:58 +0800 Subject: [PATCH 5/5] add back testng version and scope --- modules/openapi-generator/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 077e10556db5..fee44f6f80fc 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -327,6 +327,8 @@ org.testng testng + ${testng.version} + test com.github.javaparser