...

Text file src/k8s.io/kubernetes/api/openapi-spec/README.md

Documentation: k8s.io/kubernetes/api/openapi-spec

     1# Kubernetes's OpenAPI Specification
     2
     3This folder contains an [OpenAPI specification](https://github.com/OAI/OpenAPI-Specification) for Kubernetes API.
     4
     5## Vendor Extensions
     6
     7Kubernetes extends OpenAPI using these extensions. Note the version that
     8extensions have been added.
     9
    10### `x-kubernetes-group-version-kind`
    11
    12Operations and Definitions may have `x-kubernetes-group-version-kind` if they
    13are associated with a [kubernetes resource](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources).
    14
    15
    16For 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
    37Operations and Definitions may have `x-kubernetes-action` if they
    38are associated with a [kubernetes resource](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources).
    39Action can be one of `get`, `list`, `put`, `patch`, `post`, `delete`, `deletecollection`, `watch`, `watchlist`, `proxy`, or `connect`.
    40
    41
    42For 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
    59Some 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).

View as plain text