Skip to content

Commit 606cf90

Browse files
committed
feat (PHP LARAVEL) 8417: adjust route service provdider and model generation
1 parent 7c0aa8c commit 606cf90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+701
-11
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpLaravelServerCodegen.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,9 @@ public PhpLaravelServerCodegen() {
9696
/*
9797
* Model Package. Optional, if needed, this can be used in templates
9898
*/
99-
modelPackage = "models";
99+
modelPackage = "app.Models";
100100

101101
// template files want to be ignored
102-
modelTemplateFiles.clear();
103102
apiTestTemplateFiles.clear();
104103
apiDocTemplateFiles.clear();
105104
modelDocTemplateFiles.clear();

modules/openapi-generator/src/main/resources/php-laravel/app/Providers/RouteServiceProvider.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ protected function mapWebRoutes()
6565
*/
6666
protected function mapApiRoutes()
6767
{
68-
Route::prefix('api')
69-
->middleware('api')
68+
Route::middleware('api')
7069
->namespace($this->namespace)
7170
->group(base_path('routes/api.php'));
7271
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.0-SNAPSHOT
1+
3.1.2-SNAPSHOT

samples/server/petstore/php-laravel/lib/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
APP_NAME=Laravel
22
APP_ENV=local
3-
APP_KEY=base64:Rftzh5fw/3aLT8zlkCMr2cT7WoRh9taPgDtkEfk+wFo=
3+
APP_KEY=base64:DLKuAaa5bAytB73eQNHV4KBfRzQxh9ix8J3gc0sbfGc=
44
APP_DEBUG=true
55
APP_URL=http://localhost
66

samples/server/petstore/php-laravel/lib/app/Http/Controllers/FakeController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testClientModel()
5757
/**
5858
* Operation testEndpointParameters
5959
*
60-
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 .
60+
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트.
6161
*
6262
*
6363
* @return Http response
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* AdditionalPropertiesClass
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* AdditionalPropertiesClass
9+
*/
10+
class AdditionalPropertiesClass {
11+
12+
/** @var map[string,string] $map_property */
13+
private $map_property;
14+
15+
/** @var map[string,map[string,string]] $map_of_map_property */
16+
private $map_of_map_property;
17+
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Animal
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* Animal
9+
*/
10+
class Animal {
11+
12+
/** @var string $class_name */
13+
private $class_name;
14+
15+
/** @var string $color */
16+
private $color;
17+
18+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
/**
3+
* AnimalFarm
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* AnimalFarm
9+
*/
10+
class AnimalFarm {
11+
12+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* ApiResponse
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* ApiResponse
9+
*/
10+
class ApiResponse {
11+
12+
/** @var int $code */
13+
private $code;
14+
15+
/** @var string $type */
16+
private $type;
17+
18+
/** @var string $message */
19+
private $message;
20+
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
/**
3+
* ArrayOfArrayOfNumberOnly
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* ArrayOfArrayOfNumberOnly
9+
*/
10+
class ArrayOfArrayOfNumberOnly {
11+
12+
/** @var float[][] $array_array_number */
13+
private $array_array_number;
14+
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
/**
3+
* ArrayOfNumberOnly
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* ArrayOfNumberOnly
9+
*/
10+
class ArrayOfNumberOnly {
11+
12+
/** @var float[] $array_number */
13+
private $array_number;
14+
15+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* ArrayTest
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* ArrayTest
9+
*/
10+
class ArrayTest {
11+
12+
/** @var string[] $array_of_string */
13+
private $array_of_string;
14+
15+
/** @var int[][] $array_array_of_integer */
16+
private $array_array_of_integer;
17+
18+
/** @var \app.Models\ReadOnlyFirst[][] $array_array_of_model */
19+
private $array_array_of_model;
20+
21+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
/**
3+
* Capitalization
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* Capitalization
9+
*/
10+
class Capitalization {
11+
12+
/** @var string $small_camel */
13+
private $small_camel;
14+
15+
/** @var string $capital_camel */
16+
private $capital_camel;
17+
18+
/** @var string $small_snake */
19+
private $small_snake;
20+
21+
/** @var string $capital_snake */
22+
private $capital_snake;
23+
24+
/** @var string $sca_eth_flow_points */
25+
private $sca_eth_flow_points;
26+
27+
/** @var string $att_name Name of the pet*/
28+
private $att_name;
29+
30+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Cat
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* Cat
9+
*/
10+
class Cat {
11+
12+
/** @var string $class_name */
13+
private $class_name;
14+
15+
/** @var string $color */
16+
private $color;
17+
18+
/** @var bool $declawed */
19+
private $declawed;
20+
21+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* Category
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* Category
9+
*/
10+
class Category {
11+
12+
/** @var int $id */
13+
private $id;
14+
15+
/** @var string $name */
16+
private $name;
17+
18+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
/**
3+
* ClassModel
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* ClassModel
9+
*/
10+
class ClassModel {
11+
12+
/** @var string $_class */
13+
private $_class;
14+
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
/**
3+
* Client
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* Client
9+
*/
10+
class Client {
11+
12+
/** @var string $client */
13+
private $client;
14+
15+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Dog
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* Dog
9+
*/
10+
class Dog {
11+
12+
/** @var string $class_name */
13+
private $class_name;
14+
15+
/** @var string $color */
16+
private $color;
17+
18+
/** @var string $breed */
19+
private $breed;
20+
21+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* EnumArrays
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* EnumArrays
9+
*/
10+
class EnumArrays {
11+
12+
/** @var string $just_symbol */
13+
private $just_symbol;
14+
15+
/** @var string[] $array_enum */
16+
private $array_enum;
17+
18+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
/**
3+
* EnumClass
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* EnumClass
9+
*/
10+
class EnumClass {
11+
12+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* EnumTest
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* EnumTest
9+
*/
10+
class EnumTest {
11+
12+
/** @var string $enum_string */
13+
private $enum_string;
14+
15+
/** @var string $enum_string_required */
16+
private $enum_string_required;
17+
18+
/** @var int $enum_integer */
19+
private $enum_integer;
20+
21+
/** @var double $enum_number */
22+
private $enum_number;
23+
24+
/** @var \app.Models\OuterEnum $outer_enum */
25+
private $outer_enum;
26+
27+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* FileSchemaTestClass
4+
*/
5+
namespace app.Models;
6+
7+
/**
8+
* FileSchemaTestClass
9+
*/
10+
class FileSchemaTestClass {
11+
12+
/** @var \app.Models\File $file */
13+
private $file;
14+
15+
/** @var \app.Models\File[] $files */
16+
private $files;
17+
18+
}

0 commit comments

Comments
 (0)