|
@ -62,11 +62,11 @@ class SchemaBuilder |
|
|
/** |
|
|
/** |
|
|
* @throws SchemaDocumentFieldNameUnsetException |
|
|
* @throws SchemaDocumentFieldNameUnsetException |
|
|
*/ |
|
|
*/ |
|
|
public static function GenerateSchema(object $targetSchema): array |
|
|
public static function GenerateSchema(string $targetSchemaClassName): array |
|
|
{ |
|
|
{ |
|
|
$schema = []; |
|
|
$schema = []; |
|
|
$validKeys = self::GetValidKeys(); |
|
|
$validKeys = self::GetValidKeys(); |
|
|
$reflection = new ReflectionClass($targetSchema); |
|
|
$reflection = new ReflectionClass(new $targetSchemaClassName()); |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
* Schema "meta-data" from here... |
|
|
* Schema "meta-data" from here... |
|
@ -123,9 +123,9 @@ class SchemaBuilder |
|
|
* @return void |
|
|
* @return void |
|
|
* @throws SchemaDocumentFieldNameUnsetException |
|
|
* @throws SchemaDocumentFieldNameUnsetException |
|
|
*/ |
|
|
*/ |
|
|
#[NoReturn] public static function RenderSchema(object $targetSchema): void |
|
|
#[NoReturn] public static function RenderSchema(string $targetSchemaClassName): void |
|
|
{ |
|
|
{ |
|
|
$result = self::GenerateSchema(new $targetSchema()); |
|
|
$result = self::GenerateSchema($targetSchemaClassName); |
|
|
header('Content-Type: application/json'); |
|
|
header('Content-Type: application/json'); |
|
|
echo json_encode($result, JSON_PRETTY_PRINT); |
|
|
echo json_encode($result, JSON_PRETTY_PRINT); |
|
|
die(); |
|
|
die(); |
|
|