From 3a8265b6eec3ca372e28d49de38cf6f4b032a937 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 28 Dec 2022 17:28:07 +0800 Subject: [PATCH] Update opeanpi-generator dependencies (#14328) * update openapi-generator dep * update dep, fix tests with new spec * update kotlin version * revert cafferine version * add back testng version and scope --- modules/openapi-generator/pom.xml | 4 +- .../python/PythonLegacyClientCodegenTest.java | 2 +- .../PythonNextgenClientCodegenTest.java | 2 +- .../codegen/python/PythonPriorClientTest.java | 2 +- .../src/test/resources/3_0/v1beta3.yaml | 375 ++++++++++++++++++ pom.xml | 14 +- 6 files changed, 387 insertions(+), 12 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/v1beta3.yaml diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index f9dec6200d3..fee44f6f80f 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -333,7 +333,7 @@ com.github.javaparser javaparser-core - 3.24.0 + 3.24.9 test @@ -356,7 +356,7 @@ org.commonmark commonmark - 0.20.0 + 0.21.0 org.mockito 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 3af8b16d51b..28f3d68c0c5 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 class PythonLegacyClientCodegenTest { @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 2e603685ee2..38b2f97fd45 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 class PythonNextgenClientCodegenTest { @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 df88361a53d..e45b037f969 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 00000000000..512de5d79cb --- /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 48ff4fd0afa..b2b8baba7f0 100644 --- a/pom.xml +++ b/pom.xml @@ -1477,22 +1477,22 @@ 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 + 1.6.21 3.10.1 3.2.2 3.4.0 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