From f8294d5fd1fbce2250867e0fae1dd68fd506e54d Mon Sep 17 00:00:00 2001 From: Christoph Reiter <reiter.christoph@gmail.com> Date: Mon, 25 Oct 2021 11:24:28 +0200 Subject: [PATCH] Add the base prefix to the json API This adds the prefix to the URLs and the short name --- src/Entity/Organization.php | 7 ++++--- tests/ExtTest.php | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Entity/Organization.php b/src/Entity/Organization.php index 063ab07..a68b978 100644 --- a/src/Entity/Organization.php +++ b/src/Entity/Organization.php @@ -12,7 +12,7 @@ use Symfony\Component\Serializer\Annotation\Groups; * @ApiResource( * collectionOperations={ * "get" = { - * "path" = "/organizations", + * "path" = "/base/organizations", * "openapi_context" = { * "tags" = {"BaseOrganization"}, * "parameters" = { @@ -22,7 +22,7 @@ use Symfony\Component\Serializer\Annotation\Groups; * }, * "get_orgs" = { * "method" = "GET", - * "path" = "/people/{identifier}/organizations", + * "path" = "/base/people/{identifier}/organizations", * "controller" = GetOrganizationsByPerson::class, * "read" = false, * "openapi_context" = { @@ -38,7 +38,7 @@ use Symfony\Component\Serializer\Annotation\Groups; * }, * itemOperations={ * "get" = { - * "path" = "/organizations/{identifier}", + * "path" = "/base/organizations/{identifier}", * "openapi_context" = { * "tags" = {"BaseOrganization"}, * "parameters" = { @@ -49,6 +49,7 @@ use Symfony\Component\Serializer\Annotation\Groups; * }, * }, * iri="http://schema.org/Organization", + * shortName="BaseOrganization", * description="An organization", * normalizationContext={ * "jsonld_embed_context" = true, diff --git a/tests/ExtTest.php b/tests/ExtTest.php index e11f5d6..6e4e2aa 100644 --- a/tests/ExtTest.php +++ b/tests/ExtTest.php @@ -14,9 +14,9 @@ class ExtTest extends ApiTestCase $client = self::createClient(); $endpoints = [ - // FIXME: '/people/foo/organizations', - '/organizations', - '/organizations/foo', + '/base/people/foo/organizations', + '/base/organizations', + '/base/organizations/foo', ]; foreach ($endpoints as $path) { $response = $client->request('GET', $path); -- GitLab