We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8085086 commit 42481b4Copy full SHA for 42481b4
src/Extracting/Strategies/Responses/UseResponseFileTag.php
@@ -62,7 +62,12 @@ protected function getFileResponses(array $tags)
62
}
63
$status = $result[1] ?: 200;
64
$content = $result[2] ? file_get_contents($filePath, true) : '{}';
65
- $json = ! empty($result[3]) ? str_replace("'", '"', $result[3]) : '{}';
+
66
+ if (empty($result[3])) {
67
+ return ['content' => $content, 'status' => (int) $status];
68
+ }
69
70
+ $json = str_replace("'", '"', $result[3]);
71
$merged = array_merge(json_decode($content, true), json_decode($json, true));
72
73
return ['content' => json_encode($merged), 'status' => (int) $status];
0 commit comments