-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
the swagger generator is now attribute-based, added empty validators …
…for remaining types
- Loading branch information
Showing
11 changed files
with
160 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,6 @@ public function test(string $arg) | |
// $format = new UserFormat(); | ||
// var_dump($format->checkedAssign("email", "[email protected]")); | ||
|
||
/* | ||
$inDir = __DIR__ . "/../V1Module/presenters"; | ||
$outDir = __DIR__ . "/../V1Module/presenters2"; | ||
|
||
|
@@ -80,10 +79,9 @@ public function test(string $arg) | |
fwrite($newFile, $newContent); | ||
fclose($newFile); | ||
} | ||
*/ | ||
|
||
$reflection = AnnotationHelper::getMethod("App\V1Module\Presenters\RegistrationPresenter", "actionCreateAccount"); | ||
$attrs = MetaFormatHelper::extractRequestParamData($reflection); | ||
var_dump($attrs); | ||
// $reflection = AnnotationHelper::getMethod("App\V1Module\Presenters\RegistrationPresenter", "actionCreateAccount"); | ||
// $attrs = MetaFormatHelper::extractRequestParamData($reflection); | ||
// var_dump($attrs); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Helpers\MetaFormats\Validators; | ||
|
||
use App\Helpers\MetaFormats\PhpTypes; | ||
use App\Helpers\MetaFormats\PrimitiveFormatValidators; | ||
|
||
class ArrayValidator | ||
{ | ||
public const SWAGGER_TYPE = "array"; | ||
|
||
public function validate(string $value) | ||
{ | ||
///TODO: check if array, check content | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Helpers\MetaFormats\Validators; | ||
|
||
use App\Helpers\MetaFormats\PhpTypes; | ||
use App\Helpers\MetaFormats\PrimitiveFormatValidators; | ||
|
||
class BoolValidator | ||
{ | ||
public const SWAGGER_TYPE = "boolean"; | ||
|
||
public function validate(string $value) | ||
{ | ||
///TODO: check if bool | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Helpers\MetaFormats\Validators; | ||
|
||
use App\Helpers\MetaFormats\PhpTypes; | ||
use App\Helpers\MetaFormats\PrimitiveFormatValidators; | ||
|
||
class FloatValidator | ||
{ | ||
public const SWAGGER_TYPE = "number"; | ||
|
||
public function validate(string $value) | ||
{ | ||
///TODO: check if float | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Helpers\MetaFormats\Validators; | ||
|
||
use App\Helpers\MetaFormats\PhpTypes; | ||
use App\Helpers\MetaFormats\PrimitiveFormatValidators; | ||
|
||
class IntValidator | ||
{ | ||
public const SWAGGER_TYPE = "integer"; | ||
|
||
public function validate(string $value) | ||
{ | ||
///TODO: check if int | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Helpers\MetaFormats\Validators; | ||
|
||
use App\Helpers\MetaFormats\PhpTypes; | ||
use App\Helpers\MetaFormats\PrimitiveFormatValidators; | ||
|
||
class TimestampValidator | ||
{ | ||
public const SWAGGER_TYPE = "string"; | ||
|
||
public function validate(string $value) | ||
{ | ||
///TODO: check if timestamp | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters