Skip to content

Commit 1672ded

Browse files
committed
Add OperationIDs to third party resources spec
1 parent 87e16bb commit 1672ded

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

scripts/preprocess_spec.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
OUTPUT_PATH = os.path.join(os.path.dirname(__file__), 'swagger.json')
3636

37+
TPR_SPEC_PATH = os.path.join(os.path.dirname(__file__), 'thirdpartypaths.json')
38+
3739
_ops = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch']
3840

3941

@@ -103,7 +105,7 @@ def strip_tags_from_operation_id(operation, _):
103105

104106

105107
def add_thirdparty_resource_paths(spec):
106-
with open('thirdpartypaths.json', 'r') as third_party_spec_file:
108+
with open(TPR_SPEC_PATH, 'r') as third_party_spec_file:
107109
third_party_spec = json.loads(third_party_spec_file.read())
108110
for path in third_party_spec.keys():
109111
if path not in spec['paths'].keys():

scripts/thirdpartypaths.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"/apis/{fqdn}/v1/{resource}": {
33
"get": {
4+
"operationId": "listThirdPartyResource",
45
"security": [
56
{
67
"Bearer": [
@@ -48,6 +49,7 @@
4849
},
4950
"/apis/{fqdn}/v1/namespaces/{namespace}/{resource}": {
5051
"post": {
52+
"operationId": "createThirdPartyResource",
5153
"security": [
5254
{
5355
"Bearer": [
@@ -104,6 +106,7 @@
104106
},
105107
"/apis/{fqdn}/v1/namespaces/{namespace}/{resource}/{name}": {
106108
"get": {
109+
"operationId": "getThirdPartyResource",
107110
"security": [
108111
{
109112
"Bearer": [
@@ -156,6 +159,7 @@
156159
}
157160
},
158161
"delete": {
162+
"operationId": "deleteThirdPartyResource",
159163
"security": [
160164
{
161165
"Bearer": [
@@ -209,15 +213,16 @@
209213
}
210214
},
211215
"put": {
216+
"operationId": "updateThirdPartyResource",
212217
"security": [
213218
{
214219
"Bearer": [
215220

216221
]
217222
}
218223
],
219-
"summary": "Replace a Resource",
220-
"description": "Replaces the specified third party resource of the type specified",
224+
"summary": "Update a Resource",
225+
"description": "Update the specified third party resource of the type specified",
221226
"tags": [
222227
"third_party_resources"
223228
],

0 commit comments

Comments
 (0)