Skip to content

Commit 1b5fd94

Browse files
committed
Revert "Merge pull request #33 from env0/chore-handle-http-events-list"
This reverts commit 647b42e, reversing changes made to c7ad2d1.
1 parent 647b42e commit 1b5fd94

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

src/serverless-openapi-typescript.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ export default class ServerlessOpenapiTypeScript {
223223
if (customTags) openApi.tags = openApi.tags.concat(customTags)
224224

225225
Object.values(openApi.paths).forEach(path => {
226-
Object.entries(path).forEach(([methodName, method]) => {
226+
Object.values(path).forEach(method => {
227227
const httpEvent = this.functions[method.operationId]?.events?.find(
228-
(e: ApiGatewayEvent) => (e.http as any).method === methodName
228+
(e: ApiGatewayEvent) => e.http
229229
) as ApiGatewayEvent;
230230
const http: HttpEvent = httpEvent.http;
231231
if (http.documentation?.tag) {
@@ -234,7 +234,7 @@ export default class ServerlessOpenapiTypeScript {
234234
method.tags = [tagName];
235235
}
236236

237-
method.operationId = kebabCase(`${this.serverless.service.custom?.documentation?.title}-${method.operationId}-${methodName}`);
237+
method.operationId = kebabCase(`${this.serverless.service.custom?.documentation?.title}-${method.operationId}`);
238238
});
239239
});
240240
}

test/fixtures/expect-openapi-custom-tags.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ info:
1313
paths:
1414
/create:
1515
post:
16-
operationId: project-create-func-post
16+
operationId: project-create-func
1717
summary: Create Function
1818
description: |
1919
Create Function1
@@ -37,7 +37,7 @@ paths:
3737
- FooBarTitle
3838
/delete:
3939
delete:
40-
operationId: project-delete-func-delete
40+
operationId: project-delete-func
4141
summary: Delete Function
4242
description: Delete
4343
parameters: []
@@ -49,7 +49,7 @@ paths:
4949
- Project
5050
/get:
5151
get:
52-
operationId: project-get-func-get
52+
operationId: project-get-func
5353
summary: Get Function
5454
parameters: []
5555
responses:

test/fixtures/expect-openapi-full.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ info:
109109
paths:
110110
/create/{funcName}:
111111
post:
112-
operationId: project-create-func-post
112+
operationId: project-create-func
113113
summary: Create Function
114114
description: |
115115
Create Function1
@@ -163,7 +163,7 @@ paths:
163163
- Project
164164
/delete/{funcName}:
165165
delete:
166-
operationId: project-delete-func-delete
166+
operationId: project-delete-func
167167
summary: Delete Function
168168
description: Delete
169169
parameters:
@@ -181,7 +181,7 @@ paths:
181181
- Project
182182
/update:
183183
put:
184-
operationId: project-update-func-put
184+
operationId: project-update-func
185185
summary: Delete Function
186186
description: Delete
187187
requestBody:
@@ -202,7 +202,7 @@ paths:
202202
- Project
203203
/get/{funcName}:
204204
get:
205-
operationId: project-get-func-get
205+
operationId: project-get-func
206206
summary: Get Function
207207
parameters:
208208
- name: funcName

test/fixtures/expect-openapi-hyphenated-functions.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ info:
1313
paths:
1414
/create:
1515
post:
16-
operationId: project-create-func-post
16+
operationId: project-create-func
1717
summary: Create Function
1818
description: |
1919
Create Function1
@@ -37,7 +37,7 @@ paths:
3737
- FooBarTitle
3838
/delete:
3939
delete:
40-
operationId: project-delete-all-func-delete
40+
operationId: project-delete-all-func
4141
summary: Delete Function
4242
description: Delete
4343
parameters: []
@@ -49,7 +49,7 @@ paths:
4949
- Project
5050
/get:
5151
get:
52-
operationId: project-get-func-get
52+
operationId: project-get-func
5353
summary: Get Function
5454
parameters: []
5555
responses:

test/fixtures/expect-openapi-query-param-type.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ info:
1414
paths:
1515
/get:
1616
get:
17-
operationId: func-get
17+
operationId: func
1818
summary: Get Function
1919
parameters:
2020
- name: name

0 commit comments

Comments
 (0)