Add OperationIDs to third party resources spec
This commit is contained in:
parent
87e16bbd04
commit
1672ded330
@ -34,6 +34,8 @@ SPEC_URL = 'https://raw.githubusercontent.com/kubernetes/kubernetes/' \
|
||||
|
||||
OUTPUT_PATH = os.path.join(os.path.dirname(__file__), 'swagger.json')
|
||||
|
||||
TPR_SPEC_PATH = os.path.join(os.path.dirname(__file__), 'thirdpartypaths.json')
|
||||
|
||||
_ops = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch']
|
||||
|
||||
|
||||
@ -103,7 +105,7 @@ def strip_tags_from_operation_id(operation, _):
|
||||
|
||||
|
||||
def add_thirdparty_resource_paths(spec):
|
||||
with open('thirdpartypaths.json', 'r') as third_party_spec_file:
|
||||
with open(TPR_SPEC_PATH, 'r') as third_party_spec_file:
|
||||
third_party_spec = json.loads(third_party_spec_file.read())
|
||||
for path in third_party_spec.keys():
|
||||
if path not in spec['paths'].keys():
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"/apis/{fqdn}/v1/{resource}": {
|
||||
"get": {
|
||||
"operationId": "listThirdPartyResource",
|
||||
"security": [
|
||||
{
|
||||
"Bearer": [
|
||||
@ -48,6 +49,7 @@
|
||||
},
|
||||
"/apis/{fqdn}/v1/namespaces/{namespace}/{resource}": {
|
||||
"post": {
|
||||
"operationId": "createThirdPartyResource",
|
||||
"security": [
|
||||
{
|
||||
"Bearer": [
|
||||
@ -104,6 +106,7 @@
|
||||
},
|
||||
"/apis/{fqdn}/v1/namespaces/{namespace}/{resource}/{name}": {
|
||||
"get": {
|
||||
"operationId": "getThirdPartyResource",
|
||||
"security": [
|
||||
{
|
||||
"Bearer": [
|
||||
@ -156,6 +159,7 @@
|
||||
}
|
||||
},
|
||||
"delete": {
|
||||
"operationId": "deleteThirdPartyResource",
|
||||
"security": [
|
||||
{
|
||||
"Bearer": [
|
||||
@ -209,6 +213,7 @@
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"operationId": "updateThirdPartyResource",
|
||||
"security": [
|
||||
{
|
||||
"Bearer": [
|
||||
@ -216,8 +221,8 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"summary": "Replace a Resource",
|
||||
"description": "Replaces the specified third party resource of the type specified",
|
||||
"summary": "Update a Resource",
|
||||
"description": "Update the specified third party resource of the type specified",
|
||||
"tags": [
|
||||
"third_party_resources"
|
||||
],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user