|
|
@ -62,11 +62,11 @@ class SchemaBuilder |
|
|
|
/** |
|
|
|
* @throws SchemaDocumentFieldNameUnsetException |
|
|
|
*/ |
|
|
|
public static function GenerateSchema(object $targetSchema): array |
|
|
|
public static function GenerateSchema(string $targetSchemaClassName): array |
|
|
|
{ |
|
|
|
$schema = []; |
|
|
|
$validKeys = self::GetValidKeys(); |
|
|
|
$reflection = new ReflectionClass($targetSchema); |
|
|
|
$reflection = new ReflectionClass(new $targetSchemaClassName()); |
|
|
|
|
|
|
|
/* |
|
|
|
* Schema "meta-data" from here... |
|
|
@ -123,9 +123,9 @@ class SchemaBuilder |
|
|
|
* @return void |
|
|
|
* @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'); |
|
|
|
echo json_encode($result, JSON_PRETTY_PRINT); |
|
|
|
die(); |
|
|
|