diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 00fb358d9eb6..d3d8287d915b 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -561,26 +561,6 @@ paths: description: User not found /fake: - put: - tags: - - fake - summary: To test code injection */ =end - descriptions: To test code injection */ =end - operationId: testCodeInject */ =end - consumes: - - application/json - - "*/ =end'));(phpinfo('" - produces: - - application/json - - '*/ end' - parameters: - - name: test code inject */ =end - type: string - in: formData - description: To test code injection */ =end - responses: - '400': - description: To test code injection */ =end get: tags: - fake diff --git a/samples/server/petstore/lumen/app/Http/controllers/FakeApi.php b/samples/server/petstore/lumen/app/Http/controllers/FakeApi.php index 3cf90593ed93..11c9e2dc4c48 100644 --- a/samples/server/petstore/lumen/app/Http/controllers/FakeApi.php +++ b/samples/server/petstore/lumen/app/Http/controllers/FakeApi.php @@ -2,7 +2,7 @@ /** * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -129,4 +129,29 @@ class FakeApi extends Controller return response('How about implementing testEndpointParameters as a POST method ?'); } + /** + * Operation testEnumQueryParameters + * + * To test enum query parameters. + * + * + * @return Http response + */ + public function testEnumQueryParameters() + { + $input = Request::all(); + + //path params validation + + + //not path params validation + $enumQueryString = $input['enumQueryString']; + + $enumQueryInteger = $input['enumQueryInteger']; + + $enumQueryDouble = $input['enumQueryDouble']; + + + return response('How about implementing testEnumQueryParameters as a GET method ?'); + } } diff --git a/samples/server/petstore/lumen/app/Http/controllers/PetApi.php b/samples/server/petstore/lumen/app/Http/controllers/PetApi.php index 4d67bc06d1af..bd06e75fa6e9 100644 --- a/samples/server/petstore/lumen/app/Http/controllers/PetApi.php +++ b/samples/server/petstore/lumen/app/Http/controllers/PetApi.php @@ -2,7 +2,7 @@ /** * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io diff --git a/samples/server/petstore/lumen/app/Http/controllers/StoreApi.php b/samples/server/petstore/lumen/app/Http/controllers/StoreApi.php index f98782b520b9..4eae1e17c9f6 100644 --- a/samples/server/petstore/lumen/app/Http/controllers/StoreApi.php +++ b/samples/server/petstore/lumen/app/Http/controllers/StoreApi.php @@ -2,7 +2,7 @@ /** * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io diff --git a/samples/server/petstore/lumen/app/Http/controllers/UserApi.php b/samples/server/petstore/lumen/app/Http/controllers/UserApi.php index 710c9e29953f..331c90525e9b 100644 --- a/samples/server/petstore/lumen/app/Http/controllers/UserApi.php +++ b/samples/server/petstore/lumen/app/Http/controllers/UserApi.php @@ -2,7 +2,7 @@ /** * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io diff --git a/samples/server/petstore/lumen/app/Http/routes.php b/samples/server/petstore/lumen/app/Http/routes.php index d07792b9d09f..c61d6d3c4d34 100644 --- a/samples/server/petstore/lumen/app/Http/routes.php +++ b/samples/server/petstore/lumen/app/Http/routes.php @@ -2,7 +2,7 @@ /** * Swagger Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io @@ -40,6 +40,13 @@ $app->get('/', function () use ($app) { * Output-Formats: [application/xml; charset=utf-8, application/json; charset=utf-8] */ $app->POST('/fake', 'FakeApi@testEndpointParameters'); +/** + * GET testEnumQueryParameters + * Summary: To test enum query parameters + * Notes: + * Output-Formats: [application/json] + */ +$app->GET('/fake', 'FakeApi@testEnumQueryParameters'); /** * POST addPet * Summary: Add a new pet to the store