Skip to content

Commit 25fd487

Browse files
committed
add handling for dotnet
1 parent a72054f commit 25fd487

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/SDK/Language/DotNet.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,11 @@ public function getParamExample(array $param): string
285285
$output .= $example;
286286
break;
287287
case self::TYPE_OBJECT:
288-
$output .= '[object]';
288+
$output .= ($example === '{}')
289+
? '[object]'
290+
: (($formatted = json_encode(json_decode($example, true), JSON_PRETTY_PRINT))
291+
? 'new ' . preg_replace('/\n/', "\n ", $formatted)
292+
: 'new ' . $example);
289293
break;
290294
case self::TYPE_BOOLEAN:
291295
$output .= ($example) ? 'true' : 'false';

0 commit comments

Comments
 (0)