mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 12:02:43 +00:00
[PHP] [Laravel] Fix syntax errors in models (#721)
* Fix syntax errors in Models * Update samples ./bin/php-laravel-petstore-server.sh
This commit is contained in:
committed by
William Cheng
parent
a258cf3fc6
commit
2b429ee43b
@@ -96,7 +96,7 @@ public class PhpLaravelServerCodegen extends AbstractPhpCodegen {
|
|||||||
/*
|
/*
|
||||||
* Model Package. Optional, if needed, this can be used in templates
|
* Model Package. Optional, if needed, this can be used in templates
|
||||||
*/
|
*/
|
||||||
modelPackage = "app.Models";
|
modelPackage = "app\\Models";
|
||||||
|
|
||||||
// template files want to be ignored
|
// template files want to be ignored
|
||||||
apiTestTemplateFiles.clear();
|
apiTestTemplateFiles.clear();
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
3.1.2-SNAPSHOT
|
3.2.0-SNAPSHOT
|
||||||
@@ -31,14 +31,14 @@ class AnotherFakeController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Operation testSpecialTags
|
* Operation 123testSpecialTags
|
||||||
*
|
*
|
||||||
* To test special tags.
|
* To test special tags.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @return Http response
|
* @return Http response
|
||||||
*/
|
*/
|
||||||
public function testSpecialTags()
|
public function 123testSpecialTags()
|
||||||
{
|
{
|
||||||
$input = Request::all();
|
$input = Request::all();
|
||||||
|
|
||||||
@@ -47,11 +47,11 @@ class AnotherFakeController extends Controller
|
|||||||
|
|
||||||
//not path params validation
|
//not path params validation
|
||||||
if (!isset($input['client'])) {
|
if (!isset($input['client'])) {
|
||||||
throw new \InvalidArgumentException('Missing the required parameter $client when calling testSpecialTags');
|
throw new \InvalidArgumentException('Missing the required parameter $client when calling 123testSpecialTags');
|
||||||
}
|
}
|
||||||
$client = $input['client'];
|
$client = $input['client'];
|
||||||
|
|
||||||
|
|
||||||
return response('How about implementing testSpecialTags as a patch method ?');
|
return response('How about implementing 123testSpecialTags as a patch method ?');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* AdditionalPropertiesClass
|
* AdditionalPropertiesClass
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AdditionalPropertiesClass
|
* AdditionalPropertiesClass
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Animal
|
* Animal
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Animal
|
* Animal
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* AnimalFarm
|
* AnimalFarm
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AnimalFarm
|
* AnimalFarm
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* ApiResponse
|
* ApiResponse
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ApiResponse
|
* ApiResponse
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* ArrayOfArrayOfNumberOnly
|
* ArrayOfArrayOfNumberOnly
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ArrayOfArrayOfNumberOnly
|
* ArrayOfArrayOfNumberOnly
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* ArrayOfNumberOnly
|
* ArrayOfNumberOnly
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ArrayOfNumberOnly
|
* ArrayOfNumberOnly
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* ArrayTest
|
* ArrayTest
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ArrayTest
|
* ArrayTest
|
||||||
@@ -15,7 +15,7 @@ class ArrayTest {
|
|||||||
/** @var int[][] $array_array_of_integer */
|
/** @var int[][] $array_array_of_integer */
|
||||||
private $array_array_of_integer;
|
private $array_array_of_integer;
|
||||||
|
|
||||||
/** @var \app.Models\ReadOnlyFirst[][] $array_array_of_model */
|
/** @var \app\Models\ReadOnlyFirst[][] $array_array_of_model */
|
||||||
private $array_array_of_model;
|
private $array_array_of_model;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Capitalization
|
* Capitalization
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Capitalization
|
* Capitalization
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Cat
|
* Cat
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cat
|
* Cat
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Category
|
* Category
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Category
|
* Category
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* ClassModel
|
* ClassModel
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ClassModel
|
* ClassModel
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Client
|
* Client
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Client
|
* Client
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Dog
|
* Dog
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dog
|
* Dog
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* EnumArrays
|
* EnumArrays
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EnumArrays
|
* EnumArrays
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* EnumClass
|
* EnumClass
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EnumClass
|
* EnumClass
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* EnumTest
|
* EnumTest
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EnumTest
|
* EnumTest
|
||||||
@@ -21,7 +21,7 @@ class EnumTest {
|
|||||||
/** @var double $enum_number */
|
/** @var double $enum_number */
|
||||||
private $enum_number;
|
private $enum_number;
|
||||||
|
|
||||||
/** @var \app.Models\OuterEnum $outer_enum */
|
/** @var \app\Models\OuterEnum $outer_enum */
|
||||||
private $outer_enum;
|
private $outer_enum;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,17 +2,17 @@
|
|||||||
/**
|
/**
|
||||||
* FileSchemaTestClass
|
* FileSchemaTestClass
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FileSchemaTestClass
|
* FileSchemaTestClass
|
||||||
*/
|
*/
|
||||||
class FileSchemaTestClass {
|
class FileSchemaTestClass {
|
||||||
|
|
||||||
/** @var \app.Models\File $file */
|
/** @var \app\Models\File $file */
|
||||||
private $file;
|
private $file;
|
||||||
|
|
||||||
/** @var \app.Models\File[] $files */
|
/** @var \app\Models\File[] $files */
|
||||||
private $files;
|
private $files;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* FormatTest
|
* FormatTest
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* FormatTest
|
* FormatTest
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* HasOnlyReadOnly
|
* HasOnlyReadOnly
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HasOnlyReadOnly
|
* HasOnlyReadOnly
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* MapTest
|
* MapTest
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MapTest
|
* MapTest
|
||||||
@@ -18,7 +18,7 @@ class MapTest {
|
|||||||
/** @var map[string,bool] $direct_map */
|
/** @var map[string,bool] $direct_map */
|
||||||
private $direct_map;
|
private $direct_map;
|
||||||
|
|
||||||
/** @var \app.Models\StringBooleanMap $indirect_map */
|
/** @var \app\Models\StringBooleanMap $indirect_map */
|
||||||
private $indirect_map;
|
private $indirect_map;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* MixedPropertiesAndAdditionalPropertiesClass
|
* MixedPropertiesAndAdditionalPropertiesClass
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MixedPropertiesAndAdditionalPropertiesClass
|
* MixedPropertiesAndAdditionalPropertiesClass
|
||||||
@@ -15,7 +15,7 @@ class MixedPropertiesAndAdditionalPropertiesClass {
|
|||||||
/** @var \DateTime $date_time */
|
/** @var \DateTime $date_time */
|
||||||
private $date_time;
|
private $date_time;
|
||||||
|
|
||||||
/** @var map[string,\app.Models\Animal] $map */
|
/** @var map[string,\app\Models\Animal] $map */
|
||||||
private $map;
|
private $map;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Model200Response
|
* Model200Response
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Model200Response
|
* Model200Response
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* ModelReturn
|
* ModelReturn
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModelReturn
|
* ModelReturn
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Name
|
* Name
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name
|
* Name
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* NumberOnly
|
* NumberOnly
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NumberOnly
|
* NumberOnly
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Order
|
* Order
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Order
|
* Order
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* OuterComposite
|
* OuterComposite
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OuterComposite
|
* OuterComposite
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* OuterEnum
|
* OuterEnum
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OuterEnum
|
* OuterEnum
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Pet
|
* Pet
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pet
|
* Pet
|
||||||
@@ -12,7 +12,7 @@ class Pet {
|
|||||||
/** @var int $id */
|
/** @var int $id */
|
||||||
private $id;
|
private $id;
|
||||||
|
|
||||||
/** @var \app.Models\Category $category */
|
/** @var \app\Models\Category $category */
|
||||||
private $category;
|
private $category;
|
||||||
|
|
||||||
/** @var string $name */
|
/** @var string $name */
|
||||||
@@ -21,7 +21,7 @@ class Pet {
|
|||||||
/** @var string[] $photo_urls */
|
/** @var string[] $photo_urls */
|
||||||
private $photo_urls;
|
private $photo_urls;
|
||||||
|
|
||||||
/** @var \app.Models\Tag[] $tags */
|
/** @var \app\Models\Tag[] $tags */
|
||||||
private $tags;
|
private $tags;
|
||||||
|
|
||||||
/** @var string $status pet status in the store*/
|
/** @var string $status pet status in the store*/
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* ReadOnlyFirst
|
* ReadOnlyFirst
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ReadOnlyFirst
|
* ReadOnlyFirst
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* SpecialModelName
|
* SpecialModelName
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SpecialModelName
|
* SpecialModelName
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* StringBooleanMap
|
* StringBooleanMap
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StringBooleanMap
|
* StringBooleanMap
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* Tag
|
* Tag
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tag
|
* Tag
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* User
|
* User
|
||||||
*/
|
*/
|
||||||
namespace app.Models;
|
namespace app\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User
|
* User
|
||||||
|
|||||||
@@ -17,12 +17,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* patch testSpecialTags
|
* patch 123testSpecialTags
|
||||||
* Summary: To test special tags
|
* Summary: To test special tags
|
||||||
* Notes: To test special tags
|
* Notes: To test special tags and operation ID starting with number
|
||||||
* Output-Formats: [application/json]
|
* Output-Formats: [application/json]
|
||||||
*/
|
*/
|
||||||
Route::patch('/v2/another-fake/dummy', 'AnotherFakeController@testSpecialTags');
|
Route::patch('/v2/another-fake/dummy', 'AnotherFakeController@123testSpecialTags');
|
||||||
/**
|
/**
|
||||||
* patch testClientModel
|
* patch testClientModel
|
||||||
* Summary: To test \"client\" model
|
* Summary: To test \"client\" model
|
||||||
|
|||||||
Reference in New Issue
Block a user