Skip to content

Commit 4e9f815

Browse files
committed
made TODOs more future-proof
1 parent 51c1c71 commit 4e9f815

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

app/helpers/Swagger/AnnotationData.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ private function getBodyAnnotation(): string | null
3838
return null;
3939
}
4040

41-
///TODO: only supports JSON
41+
///TODO: The swagger generator only supports JSON due to the hardcoded mediaType below
4242
$head = '@OA\RequestBody(@OA\MediaType(mediaType="application/json",@OA\Schema';
4343
$body = new ParenthesesBuilder();
4444

@@ -72,7 +72,8 @@ public function toSwaggerAnnotations(string $route)
7272
$body->addValue($jsonProperties);
7373
}
7474

75-
///TODO: placeholder
75+
///TODO: A placeholder for the response type. This has to be replaced with the autogenerated meta-view
76+
/// response data structure in the future.
7677
$body->addValue('@OA\Response(response="200",description="The data")');
7778
return $httpMethodAnnotation . $body->toString();
7879
}

app/helpers/Swagger/AnnotationParameterData.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@ private function getSwaggerType(): string
7676
}
7777

7878
if (self::$typeMap[$typename] === null) {
79-
///TODO: return the commented exception
79+
///TODO: Return the commented exception below once the meta-view formats are implemented.
80+
/// This detaults to strings because custom types like 'email' are not supported yet.
8081
return 'string';
8182
}
82-
//throw new \InvalidArgumentException("Error in getSwaggerType: Unknown typename: {$typename}");
83+
//throw new \InvalidArgumentException("Error in getSwaggerType: Unknown typename: {$typename}");
8384

8485
$type = self::$typeMap[$typename];
8586
}
@@ -120,7 +121,7 @@ public function toPropertyAnnotation(): string
120121
$head = "@OA\\Property";
121122
$body = new ParenthesesBuilder();
122123

123-
///TODO: handle nullability
124+
///TODO: Once the meta-view formats are implemented, add support for property nullability here.
124125
$body->addKeyValue("property", $this->name);
125126
$body->addKeyValue("type", $this->getSwaggerType());
126127
return $head . $body->toString();

0 commit comments

Comments
 (0)