Skip to content

Commit

Permalink
Added docblock
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzondervan committed Nov 6, 2024
1 parent 90eac44 commit 0fed242
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Db/PublicationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,18 @@ public function jsonSerialize(): array
return $array;
}

/**
* Generate a JSON-Schema definition for the data field of a publication.
*
* @param IURLGenerator $urlGenerator An URL generator to generate the identifier of the schema.
*
* @return object The JSON-Schema object defining the data field of a publication.
*/
public function getSchema(IURLGenerator $urlGenerator): object
{
$schema = [];
$schema['$schema'] = 'https://json-schema.org/draft/2020-12/schema';
$schema['$id'] = $urlGenerator->getAbsoluteURL($urlGenerator->linkToRoute('openregister.Schemas.show', ['id' => $this->getUuid()]));
$schema['$id'] = $urlGenerator->getAbsoluteURL($urlGenerator->linkToRoute('opencatalogi.publication_types.show', ['id' => $this->getUuid()]));
$schema['type'] = 'object';
$schema['required'] = [];
$schema['properties'] = [];
Expand Down

0 comments on commit 0fed242

Please sign in to comment.