From daf769b67512faf4e4ebb9d76e730c79bb5402d6 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Wed, 8 Jan 2020 13:52:21 +0100 Subject: [PATCH 1/4] Trigger build procedure --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index eebcf6a..f325c0a 100644 --- a/.env +++ b/.env @@ -83,7 +83,7 @@ NOTIFICATION_ENABLED_AUTHORIZATION=sasd AUTH_ENABLED=false AUTH_PROVIDER=sasdadad -AUTH_AUTHORIZATION=sasd +AUTH_AUTHORIZATION=sasdfdsag ################################################## # Auditrail settings From 3ceddab94c37536a2b025962723e4ba5bf9b91ba Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Mon, 13 Jan 2020 14:40:32 +0100 Subject: [PATCH 2/4] (semi) definitive fix for rollout issue --- api/public/schema/publiccode.yaml | 2 +- api/src/Swagger/SwaggerDecorator.php | 53 ++++++++++++++++++++++------ 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/api/public/schema/publiccode.yaml b/api/public/schema/publiccode.yaml index bf7e82d..d770965 100644 --- a/api/public/schema/publiccode.yaml +++ b/api/public/schema/publiccode.yaml @@ -6,7 +6,7 @@ url: "https://github.com/ConductionNL/Proto-component-commonground" landingURL: "irc.zaakonline.nl" isBasedOn: "https://github.com/ConductionNL/Proto-component-commonground.git" softwareVersion: "V.0.1" -releaseDate: "2020-07-01" +releaseDate: "2020-09-01" logo: irc.zaakonline.nl monochromeLogo: img/logo-mono.svg diff --git a/api/src/Swagger/SwaggerDecorator.php b/api/src/Swagger/SwaggerDecorator.php index 6d9b5de..acb8988 100644 --- a/api/src/Swagger/SwaggerDecorator.php +++ b/api/src/Swagger/SwaggerDecorator.php @@ -23,13 +23,13 @@ final class SwaggerDecorator implements NormalizerInterface private $camelCaseToSnakeCaseNameConverter; public function __construct( - NormalizerInterface $decorated, - ParameterBagInterface $params, - CacheInterface $cache, - EntityManagerInterface $em, - AnnotationReader $annotationReader, - CamelCaseToSnakeCaseNameConverter $camelCaseToSnakeCaseNameConverter - ) { + NormalizerInterface $decorated, + ParameterBagInterface $params, + CacheInterface $cache, + EntityManagerInterface $em, + AnnotationReader $annotationReader, + CamelCaseToSnakeCaseNameConverter $camelCaseToSnakeCaseNameConverter + ) { $this->decorated = $decorated; $this->params = $params; $this->cash = $cache; @@ -114,7 +114,7 @@ public function normalize($object, $format = null, array $context = []) //$additionalEntityDocs = $this->getAdditionalEntityDocs($entity); $entityDocs = $this->getAdditionalEntityDocs($entity); // Only run if we have aditional docs - if (array_key_exists('properties', $entityDocs)) { + if(array_key_exists('properties',$entityDocs)){ $additionalDocs = array_merge($additionalDocs, $entityDocs['properties']); } @@ -418,13 +418,20 @@ private function getAdditionalEntityDocs($entity) $atributes = []; $groups = []; + foreach ($tags as $tag) { $name = $tag->getName(); $description = $tag->getDescription(); - // - //$description = (string) $description; switch ($name) { + + // Description + case 'var': + $atributes['description'] = (string) $description; + $atributes['type'] = (string) $tag->getType(); + + break; + // Docblocks case 'example': $atributes['example'] = (string) $description; @@ -437,22 +444,48 @@ private function getAdditionalEntityDocs($entity) break; // Constrainds (Validation) + case "Assert\Date": + $atributes['type'] = "string"; + $atributes['format'] = 'date'; + $atributes['example'] = \date('Y-m-d'); + break; + case "Assert\DateTime": + $atributes['type'] = "string"; + $atributes['format'] = 'date-time'; + $atributes['example'] = \date('Y-m-d H:i:s'); + break; + case "Assert\Time": + $atributes['type'] = "string"; + $atributes['format'] = 'time'; + $atributes['example'] = \date('H:i:s'); + break; + case "Assert\Timezone": + $atributes['type'] = "string"; + $atributes['format'] = 'timezone'; + $atributes['example'] = 'America/New_York'; + break; case "Assert\Uuid": + $atributes['type'] = "string"; $atributes['format'] = 'uuid'; break; case "Assert\Email": + $atributes['type'] = "string"; $atributes['format'] = 'email'; break; case "Assert\Url": + $atributes['type'] = "string"; $atributes['format'] = 'url'; break; case "Assert\Regex": + $atributes['type'] = "string"; $atributes['format'] = 'regex'; break; case "Assert\Ip": + $atributes['type'] = "string"; $atributes['format'] = 'ip'; break; case "Assert\Json": + $atributes['type'] = "string"; $atributes['format'] = 'json'; break; case "Assert\Choice": From 016da8235c2d5087d0b6f7a3f9b8b7898099ac7b Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Mon, 13 Jan 2020 15:31:29 +0100 Subject: [PATCH 3/4] Entity description for assent --- api/src/Entity/Assent.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/src/Entity/Assent.php b/api/src/Entity/Assent.php index 4fbf7da..f7ed903 100644 --- a/api/src/Entity/Assent.php +++ b/api/src/Entity/Assent.php @@ -11,6 +11,10 @@ use Symfony\Component\Validator\Constraints as Assert; /** + * An assent registers if assents are given for mutations that require one + * + * + * * @ApiResource( * normalizationContext={"groups"={"read"}, "enable_max_depth"=true}, * denormalizationContext={"groups"={"write"}, "enable_max_depth"=true} From 9f9ec3ff566c192b424d02c7070bee092a14fe29 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Mon, 13 Jan 2020 15:33:21 +0100 Subject: [PATCH 4/4] A little more documentation --- api/src/Entity/Assent.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/Entity/Assent.php b/api/src/Entity/Assent.php index f7ed903..e128180 100644 --- a/api/src/Entity/Assent.php +++ b/api/src/Entity/Assent.php @@ -13,7 +13,8 @@ /** * An assent registers if assents are given for mutations that require one * - * + * @author Ruben van der Linde + * @license EUPL * * @ApiResource( * normalizationContext={"groups"={"read"}, "enable_max_depth"=true},