Compare commits

...

10 Commits

Author SHA1 Message Date
Ryan Eberhard
fc51af92af Bump openapi generator version in java.sh (#283) 2025-10-24 07:59:39 -07:00
Kevin Lin
2f537940db Bump openapi generator in java.sh (#280) 2025-05-02 12:36:00 -07:00
Min Jin
7f27576537 separate a new path parameter resource_plural to avoid key conflict (#278)
Signed-off-by: Min Jin <minkimzz@amazon.com>
2025-02-04 10:18:59 -08:00
Min Jin
0fcae0a4a3 fixes the typo in custom object swagger model (#277)
Signed-off-by: Min Jin <minkimzz@amazon.com>
2025-02-01 08:34:56 -08:00
Colin Ihrig
b461333bb5 fix(typescript): enable importFileExtension option (#275)
This commit updates the TypeScript generator options to include
importFileExtension. This is done in order to support ESM in
the JavaScript client, as ESM requires explicit extensions.

Refs: https://github.com/kubernetes-client/javascript/pull/2062
2024-12-03 23:31:00 +00:00
Mick van Gelderen
d519da94ca Default to openapi-generator 7.10.0 in rust.sh (#273)
The openapi-generator needs to be at least 5.2.0 to build properly, see this PR: https://github.com/OpenAPITools/openapi-generator/pull/9745.
2024-11-23 21:28:56 +00:00
ArpanSolanki29
ea9a2062d5 feat: Add field selector for deletion api of custom object collection (#272) 2024-10-26 19:14:52 +01:00
Peter Kaššák
44f66ad942 Added annotationLibrary to java configuration (#271) 2024-10-17 17:03:04 +01:00
David Xia
6b9189ae4e feat: add GET listCustomObjectForAllNamespaces (#269)
for the API path `/apis/{group}/{version}/{plural}`.
We define a new key `/apis/{group}/{version}/{plural}#[U+200E]`
in `custom_objects_spec.json` to work around this limitation.

> OpenAPI defines a unique operation as a combination of a path and an HTTP
> method. This means that two GET or two POST methods for the same path are not
> allowed.

— https://swagger.io/docs/specification/paths-and-operations

We use the hair space empty character to visually hide this path param from the
Swagger UI.

addresses #268

Work around was taken from [here][1].

[1]: https://github.com/OAI/OpenAPI-Specification/issues/182#issuecomment-771566673
2024-09-18 16:26:44 +01:00
Brendan Burns
37662b2a59 Add nullable arrays and maps. (#267) 2024-09-09 19:32:05 +01:00
5 changed files with 139 additions and 2 deletions

View File

@@ -44,6 +44,131 @@
}
}
},
"/apis/{group}/{version}/{resource_plural}": {
"parameters": [
{
"uniqueItems": true,
"type": "string",
"description": "If 'true', then the output is pretty printed.",
"name": "pretty",
"in": "query"
},
{
"name": "group",
"in": "path",
"required": true,
"description": "The custom resource's group name",
"type": "string"
},
{
"name": "version",
"in": "path",
"required": true,
"description": "The custom resource's version",
"type": "string"
},
{
"name": "resource_plural",
"in": "path",
"required": true,
"description": "The custom resource's plural name. For TPRs this would be lowercase plural kind.",
"type": "string"
}
],
"get": {
"operationId": "listCustomObjectForAllNamespaces",
"description": "list or watch namespace scoped custom objects",
"tags": [
"custom_objects"
],
"consumes": [
"*/*"
],
"produces": [
"application/json",
"application/json;stream=watch"
],
"schemes": [
"https"
],
"parameters": [
{
"description": "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.",
"in": "query",
"name": "allowWatchBookmarks",
"type": "boolean",
"uniqueItems": true
},
{
"uniqueItems": true,
"type": "string",
"description": "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.",
"name": "continue",
"in": "query"
},
{
"uniqueItems": true,
"type": "string",
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
"name": "fieldSelector",
"in": "query"
},
{
"uniqueItems": true,
"type": "string",
"description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.",
"name": "labelSelector",
"in": "query"
},
{
"uniqueItems": true,
"type": "integer",
"description": "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.",
"name": "limit",
"in": "query"
},
{
"uniqueItems": true,
"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. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.",
"name": "resourceVersion",
"in": "query"
},
{
"description": "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset",
"in": "query",
"name": "resourceVersionMatch",
"type": "string",
"uniqueItems": true
},
{
"uniqueItems": true,
"type": "integer",
"description": "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.",
"name": "timeoutSeconds",
"in": "query"
},
{
"name": "watch",
"uniqueItems": true,
"type": "boolean",
"description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object"
}
},
"401": {
"description": "Unauthorized"
}
}
}
},
"/apis/{group}/{version}/{plural}": {
"parameters": [
{
@@ -540,6 +665,13 @@
"name": "dryRun",
"type": "string",
"uniqueItems": true
},
{
"description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.",
"in": "query",
"name": "fieldSelector",
"type": "string",
"uniqueItems": true
}
],
"responses": {

View File

@@ -49,7 +49,7 @@ popd > /dev/null
source "${SCRIPT_ROOT}/openapi-generator/client-generator.sh"
source "${SETTING_FILE}"
OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v7.6.0}" \
OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v7.16.0}" \
CLIENT_LANGUAGE=java; \
CLEANUP_DIRS=(docs src/test/java/io/kubernetes/client/openapi/apis src/main/java/io/kubernetes/client/openapi/apis src/main/java/io/kubernetes/client/openapi/models src/main/java/io/kubernetes/client/openapi/auth gradle); \
kubeclient::generator::generate_client "${OUTPUT_DIR}"

View File

@@ -29,6 +29,7 @@
<configuration>
<generateApis>${env.GENERATE_APIS}</generateApis>
<generateModelDocumentation>false</generateModelDocumentation>
<openapiNormalizer>SET_CONTAINER_TO_NULLABLE="array|map"</openapiNormalizer>
<importMappings>
V1ListMeta=io.kubernetes.client.openapi.models.V1ListMeta,
V1ObjectMeta=io.kubernetes.client.openapi.models.V1ObjectMeta,
@@ -103,6 +104,7 @@
<dateLibrary>java8</dateLibrary>
<useRxJava>false</useRxJava>
<useJakartaEe>true</useJakartaEe>
<annotationLibrary>swagger1</annotationLibrary>
<library>${env.LIBRARY}</library>
<useSingleRequestParameter>${use-single-parameter}</useSingleRequestParameter>
<useReflectionEqualsHashCode>false</useReflectionEqualsHashCode>

View File

@@ -46,6 +46,8 @@ popd > /dev/null
source "${SCRIPT_ROOT}/openapi-generator/client-generator.sh"
source "${SETTING_FILE}"
OPENAPI_GENERATOR_COMMIT="${OPENAPI_GENERATOR_COMMIT:-v7.10.0}" \
CLIENT_LANGUAGE=rust; \
CLEANUP_DIRS=(docs lib); \
kubeclient::generator::generate_client "${OUTPUT_DIR}"

View File

@@ -35,6 +35,7 @@
<npmName>kubernetes-client-typescript</npmName>
<npmVersion>${generator.client.version}</npmVersion>
<modelPropertyNaming>original</modelPropertyNaming>
<importFileExtension>.js</importFileExtension>
</configOptions>
<typeMappings>int-or-string=IntOrString,date-time-micro=V1MicroTime</typeMappings>
</configuration>