[PHP]Generated lumen code can contain dots in routes (#985)

* Update README

* Remove the codes checking dots contained in path

* Update samples
This commit is contained in:
Akihito Nakano 2018-09-07 17:37:35 +09:00 committed by GitHub
parent a0f8c5e468
commit 4a9b0a91aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 19 deletions

View File

@ -118,10 +118,6 @@ public class PhpLumenServerCodegen extends AbstractPhpCodegen {
for (CodegenOperation op : operations) {
op.httpMethod = op.httpMethod.toLowerCase(Locale.ROOT);
// check to see if the path contains ".", which is not supported by Lumen
if (op.path != null && op.path.contains(".")) {
throw new IllegalArgumentException("'.' (dot) is not supported by PHP Lumen.");
}
}
// sort the endpoints in ascending to avoid the route priority issure.

View File

@ -14,3 +14,8 @@ This example uses the [Lumen Framework](http://lumen.laravel.com/). To see how
Using `composer install` to install the framework and dependencies via [Composer](http://getcomposer.org/).
### Running the generated server stub
```bash
php -S localhost:8080 public/index.php
```

View File

@ -1 +1 @@
3.0.0-SNAPSHOT
3.3.0-SNAPSHOT

View File

@ -1,11 +1,11 @@
<?php
/**
* OpenAPI Petstore ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end --
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
*
* OpenAPI spec version: 1.0.0 ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc ' \" =end -- \\r\\n \\n \\r
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@ -29,7 +29,7 @@ class FakeApi extends Controller
/**
* Operation testCodeInjectEndRnNR
*
* To test code injection ' \" =end -- \\r\\n \\n \\r.
* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r.
*
*
* @return Http response

View File

@ -1,11 +1,11 @@
<?php
/**
* OpenAPI Petstore ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ' \" =end --
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end --
*
* OpenAPI spec version: 1.0.0 ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc ' \" =end -- \\r\\n \\n \\r
* OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r
* Contact: something@something.abc *_/ ' \" =end -- \\r\\n \\n \\r
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@ -13,8 +13,8 @@
*/
/**
* OpenAPI Petstore &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
* @version 1.0.0 &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
* OpenAPI Petstore *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
* @version 1.0.0 *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
*/
$app->get('/', function () use ($app) {
@ -23,9 +23,9 @@ $app->get('/', function () use ($app) {
/**
* put testCodeInjectEndRnNR
* Summary: To test code injection &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
* Notes:
* Summary: To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
* Notes: To test code injection *_/ &#39; \&quot; &#x3D;end -- \\r\\n \\n \\r
*/
$app->put('/fake', 'FakeApi@testCodeInjectEndRnNR');
$app->put('/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r/fake', 'FakeApi@testCodeInjectEndRnNR');

View File

@ -14,3 +14,8 @@ This example uses the [Lumen Framework](http://lumen.laravel.com/). To see how
Using `composer install` to install the framework and dependencies via [Composer](http://getcomposer.org/).
### Running the generated server stub
```bash
php -S localhost:8080 public/index.php
```

View File

@ -14,3 +14,8 @@ This example uses the [Lumen Framework](http://lumen.laravel.com/). To see how
Using `composer install` to install the framework and dependencies via [Composer](http://getcomposer.org/).
### Running the generated server stub
```bash
php -S localhost:8080 public/index.php
```