Skip to content

Commit 178b8a7

Browse files
authored
Zapier generator api template improvement (#16121)
* minor zapier api template fixes * updated samples * added zapier validation action * readded zapier beta tags * fixed zapier validation action * updated samples * improved zapier api names * updated samples * fixed zapier noun and label
1 parent 28e822d commit 178b8a7

File tree

4 files changed

+42
-42
lines changed

4 files changed

+42
-42
lines changed

modules/openapi-generator/src/main/resources/zapier/api.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ module.exports = {
1515
{{#operation}}
1616
{{operationId}}: {
1717
key: '{{operationId}}',
18-
noun: '{{baseName}}',
18+
noun: '{{#tags}}{{name}}{{/tags}}',
1919
display: {
20-
label: '{{operationId}}',
20+
label: '{{summary}}',
2121
description: '{{#notes}}{{.}}{{/notes}}',
2222
hidden: false,
2323
},

samples/client/petstore/zapier/apis/PetApi.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ const FormData = require('form-data');
77
module.exports = {
88
addPet: {
99
key: 'addPet',
10-
noun: 'Pet',
10+
noun: 'pet',
1111
display: {
12-
label: 'addPet',
12+
label: 'Add a new pet to the store',
1313
description: '',
1414
hidden: false,
1515
},
@@ -47,9 +47,9 @@ module.exports = {
4747
},
4848
deletePet: {
4949
key: 'deletePet',
50-
noun: 'Pet',
50+
noun: 'pet',
5151
display: {
52-
label: 'deletePet',
52+
label: 'Deletes a pet',
5353
description: '',
5454
hidden: false,
5555
},
@@ -95,9 +95,9 @@ module.exports = {
9595
},
9696
findPetsByStatus: {
9797
key: 'findPetsByStatus',
98-
noun: 'Pet',
98+
noun: 'pet',
9999
display: {
100-
label: 'findPetsByStatus',
100+
label: 'Finds Pets by status',
101101
description: 'Multiple status values can be provided with comma separated strings',
102102
hidden: false,
103103
},
@@ -138,9 +138,9 @@ module.exports = {
138138
},
139139
findPetsByTags: {
140140
key: 'findPetsByTags',
141-
noun: 'Pet',
141+
noun: 'pet',
142142
display: {
143-
label: 'findPetsByTags',
143+
label: 'Finds Pets by tags',
144144
description: 'Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.',
145145
hidden: false,
146146
},
@@ -181,9 +181,9 @@ module.exports = {
181181
},
182182
getPetById: {
183183
key: 'getPetById',
184-
noun: 'Pet',
184+
noun: 'pet',
185185
display: {
186-
label: 'getPetById',
186+
label: 'Find pet by ID',
187187
description: 'Returns a single pet',
188188
hidden: false,
189189
},
@@ -225,9 +225,9 @@ module.exports = {
225225
},
226226
updatePet: {
227227
key: 'updatePet',
228-
noun: 'Pet',
228+
noun: 'pet',
229229
display: {
230-
label: 'updatePet',
230+
label: 'Update an existing pet',
231231
description: '',
232232
hidden: false,
233233
},
@@ -265,9 +265,9 @@ module.exports = {
265265
},
266266
updatePetWithForm: {
267267
key: 'updatePetWithForm',
268-
noun: 'Pet',
268+
noun: 'pet',
269269
display: {
270-
label: 'updatePetWithForm',
270+
label: 'Updates a pet in the store with form data',
271271
description: '',
272272
hidden: false,
273273
},
@@ -318,9 +318,9 @@ module.exports = {
318318
},
319319
uploadFile: {
320320
key: 'uploadFile',
321-
noun: 'Pet',
321+
noun: 'pet',
322322
display: {
323-
label: 'uploadFile',
323+
label: 'uploads an image',
324324
description: '',
325325
hidden: false,
326326
},

samples/client/petstore/zapier/apis/StoreApi.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const utils = require('../utils/utils');
55
module.exports = {
66
deleteOrder: {
77
key: 'deleteOrder',
8-
noun: 'Store',
8+
noun: 'store',
99
display: {
10-
label: 'deleteOrder',
10+
label: 'Delete purchase order by ID',
1111
description: 'For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors',
1212
hidden: false,
1313
},
@@ -48,9 +48,9 @@ module.exports = {
4848
},
4949
getInventory: {
5050
key: 'getInventory',
51-
noun: 'Store',
51+
noun: 'store',
5252
display: {
53-
label: 'getInventory',
53+
label: 'Returns pet inventories by status',
5454
description: 'Returns a map of status codes to quantities',
5555
hidden: false,
5656
},
@@ -85,9 +85,9 @@ module.exports = {
8585
},
8686
getOrderById: {
8787
key: 'getOrderById',
88-
noun: 'Store',
88+
noun: 'store',
8989
display: {
90-
label: 'getOrderById',
90+
label: 'Find purchase order by ID',
9191
description: 'For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions',
9292
hidden: false,
9393
},
@@ -129,9 +129,9 @@ module.exports = {
129129
},
130130
placeOrder: {
131131
key: 'placeOrder',
132-
noun: 'Store',
132+
noun: 'store',
133133
display: {
134-
label: 'placeOrder',
134+
label: 'Place an order for a pet',
135135
description: '',
136136
hidden: false,
137137
},

samples/client/petstore/zapier/apis/UserApi.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const utils = require('../utils/utils');
55
module.exports = {
66
createUser: {
77
key: 'createUser',
8-
noun: 'User',
8+
noun: 'user',
99
display: {
10-
label: 'createUser',
10+
label: 'Create user',
1111
description: 'This can only be done by the logged in user.',
1212
hidden: false,
1313
},
@@ -44,9 +44,9 @@ module.exports = {
4444
},
4545
createUsersWithArrayInput: {
4646
key: 'createUsersWithArrayInput',
47-
noun: 'User',
47+
noun: 'user',
4848
display: {
49-
label: 'createUsersWithArrayInput',
49+
label: 'Creates list of users with given input array',
5050
description: '',
5151
hidden: false,
5252
},
@@ -87,9 +87,9 @@ module.exports = {
8787
},
8888
createUsersWithListInput: {
8989
key: 'createUsersWithListInput',
90-
noun: 'User',
90+
noun: 'user',
9191
display: {
92-
label: 'createUsersWithListInput',
92+
label: 'Creates list of users with given input array',
9393
description: '',
9494
hidden: false,
9595
},
@@ -130,9 +130,9 @@ module.exports = {
130130
},
131131
deleteUser: {
132132
key: 'deleteUser',
133-
noun: 'User',
133+
noun: 'user',
134134
display: {
135-
label: 'deleteUser',
135+
label: 'Delete user',
136136
description: 'This can only be done by the logged in user.',
137137
hidden: false,
138138
},
@@ -173,9 +173,9 @@ module.exports = {
173173
},
174174
getUserByName: {
175175
key: 'getUserByName',
176-
noun: 'User',
176+
noun: 'user',
177177
display: {
178-
label: 'getUserByName',
178+
label: 'Get user by user name',
179179
description: '',
180180
hidden: false,
181181
},
@@ -217,9 +217,9 @@ module.exports = {
217217
},
218218
loginUser: {
219219
key: 'loginUser',
220-
noun: 'User',
220+
noun: 'user',
221221
display: {
222-
label: 'loginUser',
222+
label: 'Logs user into the system',
223223
description: '',
224224
hidden: false,
225225
},
@@ -268,9 +268,9 @@ module.exports = {
268268
},
269269
logoutUser: {
270270
key: 'logoutUser',
271-
noun: 'User',
271+
noun: 'user',
272272
display: {
273-
label: 'logoutUser',
273+
label: 'Logs out current logged in user session',
274274
description: '',
275275
hidden: false,
276276
},
@@ -305,9 +305,9 @@ module.exports = {
305305
},
306306
updateUser: {
307307
key: 'updateUser',
308-
noun: 'User',
308+
noun: 'user',
309309
display: {
310-
label: 'updateUser',
310+
label: 'Updated user',
311311
description: 'This can only be done by the logged in user.',
312312
hidden: false,
313313
},

0 commit comments

Comments
 (0)