diff --git a/.env b/.env index 5e51021a..65ca368d 100644 --- a/.env +++ b/.env @@ -23,7 +23,6 @@ APP_BUILD=dev # The description for this api APP_DESCRIPTION='Naast deze JSON rest API is er ook een [graphql](/graphql) interface beschikbaar.' - APP_LOGO=pc.zaakonline.nl APP_HOME=pc.zaakonline.nl diff --git a/api/public/schema/publiccode.yaml b/api/public/schema/publiccode.yaml index 0a500f1a..a1bd7f55 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: "pc.zaakonline.nl" isBasedOn: "https://github.com/ConductionNL/Proto-component-commonground.git" softwareVersion: "V.0.1" -releaseDate: "2020-06-01" +releaseDate: "2020-13-01" logo: pc.zaakonline.nl monochromeLogo: img/logo-mono.svg diff --git a/api/src/Entity/ExampleEntity.php b/api/src/Entity/ExampleEntity.php index 2e65a2ba..c44245cd 100644 --- a/api/src/Entity/ExampleEntity.php +++ b/api/src/Entity/ExampleEntity.php @@ -37,7 +37,7 @@ class ExampleEntity { /** - * @var \Ramsey\Uuid\UuidInterface + * @var \Ramsey\Uuid\UuidInterface The id of this entity * * @example e2984465-190a-4562-829e-a8cca81aa35d * diff --git a/api/src/Swagger/SwaggerDecorator.php b/api/src/Swagger/SwaggerDecorator.php index b0610232..9f09248e 100644 --- a/api/src/Swagger/SwaggerDecorator.php +++ b/api/src/Swagger/SwaggerDecorator.php @@ -416,15 +416,22 @@ private function getAdditionalEntityDocs($entity) $docblock = $factory->create($property->getDocComment()); $tags = $docblock->getTags(); $atributes = []; - $groups = []; + $groups = []; + foreach ($tags as $tag) { $name = $tag->getName(); - $description = $tag->getDescription(); - // - //$description = (string) $description; + $description = $tag->getDescription(); switch ($name) { + + // Description + case 'var': + $atributes['description'] = (string) $description; + $atributes['type'] = (string) $tag->getType(); + + break; + // Docblocks case 'example': $atributes['example'] = (string) $description; @@ -436,23 +443,49 @@ private function getAdditionalEntityDocs($entity) $groups = $propertyAnnotation->getGroups(); break; - // Constrainds (Validation) + // 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":