mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
[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:
parent
a0f8c5e468
commit
4a9b0a91aa
@ -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.
|
||||
|
@ -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
|
||||
```
|
||||
|
@ -1 +1 @@
|
||||
3.0.0-SNAPSHOT
|
||||
3.3.0-SNAPSHOT
|
@ -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
|
||||
|
@ -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 ' \" =end -- \\r\\n \\n \\r
|
||||
* @version 1.0.0 ' \" =end -- \\r\\n \\n \\r
|
||||
* OpenAPI Petstore *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* @version 1.0.0 *_/ ' \" =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 ' \" =end -- \\r\\n \\n \\r
|
||||
* Notes:
|
||||
* Summary: To test code injection *_/ ' \" =end -- \\r\\n \\n \\r
|
||||
* Notes: To test code injection *_/ ' \" =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');
|
||||
|
||||
|
@ -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
|
||||
```
|
||||
|
@ -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
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user