diff --git a/examples/Schemas/Message.php b/examples/Schemas/Message.php index 6381b9e..ca13c2c 100644 --- a/examples/Schemas/Message.php +++ b/examples/Schemas/Message.php @@ -9,7 +9,7 @@ use Darksparrow\AuxiliumSchemaBuilder\Attributes\SchemaDocument; use Darksparrow\AuxiliumSchemaBuilder\Attributes\SchemaDocumentField; #[SchemaDocument( - Name: "Message", + Name: "message", MimeType: "message/rfc822", )] class Message diff --git a/examples/Schemas/Organisation.php b/examples/Schemas/Organisation.php index b374a54..d9ff4e2 100644 --- a/examples/Schemas/Organisation.php +++ b/examples/Schemas/Organisation.php @@ -1,4 +1,4 @@ - + + + tests + + + diff --git a/src/Attributes/SchemaDocument.php b/src/Attributes/SchemaDocument.php index 80e9d89..4b7e554 100644 --- a/src/Attributes/SchemaDocument.php +++ b/src/Attributes/SchemaDocument.php @@ -10,6 +10,7 @@ use PhpParser\Node\Name; #[\Attribute] class SchemaDocument extends Attribute { + public string $Name; public int $MaxSize; public string $Comment; public string $MimeType; @@ -21,6 +22,7 @@ class SchemaDocument extends Attribute string $MimeType = "" ) { + $this->Name = $Name; $this->MaxSize = $MaxSize; $this->Comment = $Comment; $this->MimeType = $MimeType; diff --git a/src/Utilities/URLHandling.php b/src/Utilities/URLHandling.php new file mode 100644 index 0000000..cd299d8 --- /dev/null +++ b/src/Utilities/URLHandling.php @@ -0,0 +1,24 @@ +getAttributes() as $attribute) + { + if($attribute->getName() === SchemaDocument::class) + { + $name = $attribute->getArguments()["Name"]; + return self::$URLBase . $name . ".json"; + } + } + die(); + } +} diff --git a/tests/SchemaURITest.php b/tests/SchemaURITest.php new file mode 100644 index 0000000..5e472b4 --- /dev/null +++ b/tests/SchemaURITest.php @@ -0,0 +1,20 @@ +