From 1672ded330273955ea6ce6688828366c03c0dd8a Mon Sep 17 00:00:00 2001 From: mbohlool Date: Fri, 19 May 2017 15:23:06 -0700 Subject: [PATCH] Add OperationIDs to third party resources spec --- scripts/preprocess_spec.py | 4 +++- scripts/thirdpartypaths.json | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/preprocess_spec.py b/scripts/preprocess_spec.py index da5352611..6a903b9e6 100644 --- a/scripts/preprocess_spec.py +++ b/scripts/preprocess_spec.py @@ -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(): diff --git a/scripts/thirdpartypaths.json b/scripts/thirdpartypaths.json index 5dd01f4cc..367df9e96 100644 --- a/scripts/thirdpartypaths.json +++ b/scripts/thirdpartypaths.json @@ -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" ],