Skip to content

Commit 2f9405e

Browse files
committed
loose and Format attributes are now merged when generating swagger
1 parent d7d7bbc commit 2f9405e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

app/helpers/Swagger/AnnotationHelper.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,13 @@ public static function extractAttributeData(string $className, string $methodNam
368368
$httpMethod = self::extractAnnotationHttpMethod($methodAnnotations);
369369
$reflectionMethod = self::getMethod($className, $methodName);
370370

371+
// extract loose attributes
372+
$attributeData = MetaFormatHelper::extractRequestParamData($reflectionMethod);
373+
374+
// if the endpoint is linked to a format, add the format class attributes
371375
$format = MetaFormatHelper::extractFormatFromAttribute($reflectionMethod);
372-
// if the endpoint is linked to a format, use the format class
373376
if ($format !== null) {
374-
$attributeData = FormatCache::getFieldDefinitions($format);
375-
// otherwise use loose param attributes
376-
} else {
377-
$attributeData = MetaFormatHelper::extractRequestParamData($reflectionMethod);
377+
$attributeData = array_merge($attributeData, FormatCache::getFieldDefinitions($format));
378378
}
379379

380380
$params = array_map(function ($data) {

0 commit comments

Comments
 (0)