k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/api/openapi-spec/README.md (about)

     1  # Kubernetes's OpenAPI Specification
     2  
     3  This folder contains an [OpenAPI specification](https://github.com/OAI/OpenAPI-Specification) for Kubernetes API.
     4  
     5  ## Vendor Extensions
     6  
     7  Kubernetes extends OpenAPI using these extensions. Note the version that
     8  extensions have been added.
     9  
    10  ### `x-kubernetes-group-version-kind`
    11  
    12  Operations and Definitions may have `x-kubernetes-group-version-kind` if they
    13  are associated with a [kubernetes resource](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources).
    14  
    15  
    16  For example:
    17  
    18  ``` json
    19  "paths": {
    20      ...
    21      "/api/v1/namespaces/{namespace}/pods/{name}": {
    22          ...
    23          "get": {
    24          ...
    25              "x-kubernetes-group-version-kind": {
    26              "group": "",
    27              "version": "v1",
    28              "kind": "Pod"
    29              }
    30          }
    31      }
    32  }
    33  ```
    34  
    35  ### `x-kubernetes-action`
    36  
    37  Operations and Definitions may have `x-kubernetes-action` if they
    38  are associated with a [kubernetes resource](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources).
    39  Action can be one of `get`, `list`, `put`, `patch`, `post`, `delete`, `deletecollection`, `watch`, `watchlist`, `proxy`, or `connect`.
    40  
    41  
    42  For example:
    43  
    44  ``` json
    45  "paths": {
    46      ...
    47      "/api/v1/namespaces/{namespace}/pods/{name}": {
    48          ...
    49          "get": {
    50          ...
    51              "x-kubernetes-action": "list"
    52          }
    53      }
    54  }
    55  ```
    56  
    57  ### `x-kubernetes-patch-strategy` and `x-kubernetes-patch-merge-key`
    58  
    59  Some of the definitions may have these extensions. For more information about PatchStrategy and PatchMergeKey see
    60  [strategic-merge-patch](https://git.k8s.io/community/contributors/devel/sig-api-machinery/strategic-merge-patch.md).