mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-06 16:36:12 +00:00
add test case for nullable parent property (#16552)
* add nullable case to spring test spec * generate samples for changed spring input * add nullable case to general test spec * generate samples for changed general input * generate samples again * generates samples again * re-build from new sources, generates samples again
This commit is contained in:
@@ -426,6 +426,30 @@ class FakeController extends Controller
|
||||
|
||||
return response('How about implementing testJsonFormData as a get method ?');
|
||||
}
|
||||
/**
|
||||
* Operation testNullable
|
||||
*
|
||||
* test nullable parent property.
|
||||
*
|
||||
*
|
||||
* @return Http response
|
||||
*/
|
||||
public function testNullable()
|
||||
{
|
||||
$input = Request::all();
|
||||
|
||||
//path params validation
|
||||
|
||||
|
||||
//not path params validation
|
||||
if (!isset($input['childWithNullable'])) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $childWithNullable when calling testNullable');
|
||||
}
|
||||
$childWithNullable = $input['childWithNullable'];
|
||||
|
||||
|
||||
return response('How about implementing testNullable as a post method ?');
|
||||
}
|
||||
/**
|
||||
* Operation fakeOuterBooleanSerialize
|
||||
*
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* ChildWithNullable
|
||||
*/
|
||||
namespace app\Models;
|
||||
|
||||
/**
|
||||
* ChildWithNullable
|
||||
*/
|
||||
class ChildWithNullable {
|
||||
|
||||
/** @var string $type */
|
||||
public $type = "";
|
||||
|
||||
/** @var string|null $nullableProperty */
|
||||
public $nullableProperty = null;
|
||||
|
||||
/** @var string $otherProperty */
|
||||
public $otherProperty = "";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* ParentWithNullable
|
||||
*/
|
||||
namespace app\Models;
|
||||
|
||||
/**
|
||||
* ParentWithNullable
|
||||
*/
|
||||
class ParentWithNullable {
|
||||
|
||||
/** @var string $type */
|
||||
public $type = "";
|
||||
|
||||
/** @var string|null $nullableProperty */
|
||||
public $nullableProperty = null;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user