Skip to content

Commit 3c9b172

Browse files
authored
Merge pull request #3274 from wing328/fix_lumne
Remove security test from petstore-with-fake-endpoints-models-for-testing
2 parents 6919578 + 393b44d commit 3c9b172

File tree

6 files changed

+37
-25
lines changed

6 files changed

+37
-25
lines changed

modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -561,26 +561,6 @@ paths:
561561
description: User not found
562562

563563
/fake:
564-
put:
565-
tags:
566-
- fake
567-
summary: To test code injection */ =end
568-
descriptions: To test code injection */ =end
569-
operationId: testCodeInject */ =end
570-
consumes:
571-
- application/json
572-
- "*/ =end'));(phpinfo('"
573-
produces:
574-
- application/json
575-
- '*/ end'
576-
parameters:
577-
- name: test code inject */ =end
578-
type: string
579-
in: formData
580-
description: To test code injection */ =end
581-
responses:
582-
'400':
583-
description: To test code injection */ =end
584564
get:
585565
tags:
586566
- fake

samples/server/petstore/lumen/app/Http/controllers/FakeApi.php

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Swagger Petstore
5-
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
5+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
66
*
77
* OpenAPI spec version: 1.0.0
88
* Contact: [email protected]
@@ -129,4 +129,29 @@ public function testEndpointParameters()
129129

130130
return response('How about implementing testEndpointParameters as a POST method ?');
131131
}
132+
/**
133+
* Operation testEnumQueryParameters
134+
*
135+
* To test enum query parameters.
136+
*
137+
*
138+
* @return Http response
139+
*/
140+
public function testEnumQueryParameters()
141+
{
142+
$input = Request::all();
143+
144+
//path params validation
145+
146+
147+
//not path params validation
148+
$enumQueryString = $input['enumQueryString'];
149+
150+
$enumQueryInteger = $input['enumQueryInteger'];
151+
152+
$enumQueryDouble = $input['enumQueryDouble'];
153+
154+
155+
return response('How about implementing testEnumQueryParameters as a GET method ?');
156+
}
132157
}

samples/server/petstore/lumen/app/Http/controllers/PetApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Swagger Petstore
5-
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
5+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
66
*
77
* OpenAPI spec version: 1.0.0
88
* Contact: [email protected]

samples/server/petstore/lumen/app/Http/controllers/StoreApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Swagger Petstore
5-
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
5+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
66
*
77
* OpenAPI spec version: 1.0.0
88
* Contact: [email protected]

samples/server/petstore/lumen/app/Http/controllers/UserApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Swagger Petstore
5-
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
5+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
66
*
77
* OpenAPI spec version: 1.0.0
88
* Contact: [email protected]

samples/server/petstore/lumen/app/Http/routes.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Swagger Petstore
5-
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
5+
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
66
*
77
* OpenAPI spec version: 1.0.0
88
* Contact: [email protected]
@@ -40,6 +40,13 @@
4040
* Output-Formats: [application/xml; charset=utf-8, application/json; charset=utf-8]
4141
*/
4242
$app->POST('/fake', 'FakeApi@testEndpointParameters');
43+
/**
44+
* GET testEnumQueryParameters
45+
* Summary: To test enum query parameters
46+
* Notes:
47+
* Output-Formats: [application/json]
48+
*/
49+
$app->GET('/fake', 'FakeApi@testEnumQueryParameters');
4350
/**
4451
* POST addPet
4552
* Summary: Add a new pet to the store

0 commit comments

Comments
 (0)