Skip to content

Commit c7ae61b

Browse files
committed
Add OpenAPI README file
1 parent c13d891 commit c7ae61b

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

api/openapi-spec/README.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Kubernetes's OpenAPI Specification
2+
3+
This folder contains an [OpenAPI specification][openapi] for Kubernetes API.
4+
5+
## Vendor Extensions
6+
7+
Kuberntes extends OpenAPI using these extensions. Note the version that
8+
extensions has 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://github.com/kubernetes/community/blob/master/contributors/devel/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://github.com/kubernetes/community/blob/master/contributors/devel/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://github.com/kubernetes/community/blob/3a1e6d22f812751ee88eccf7c59101852de63d5b/contributors/devel/strategic-merge-patch.md).

hack/verify-openapi-spec.sh

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ cp -a "${SPECROOT}" "${TMP_SPECROOT}"
3636
trap "cp -a ${TMP_SPECROOT} ${SPECROOT}/..; rm -rf ${_tmp}" EXIT SIGINT
3737
rm ${SPECROOT}/*
3838
cp ${TMP_SPECROOT}/BUILD ${SPECROOT}/BUILD
39+
cp ${TMP_SPECROOT}/README.md ${SPECROOT}/README.md
3940

4041
"${KUBE_ROOT}/hack/update-openapi-spec.sh"
4142
echo "diffing ${SPECROOT} against freshly generated openapi spec"

0 commit comments

Comments
 (0)