We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25fd487 commit 5b91f94Copy full SHA for 5b91f94
src/SDK/Language/Go.php
@@ -265,7 +265,11 @@ public function getParamExample(array $param): string
265
$output .= 'interface{}{' . $example . '}';
266
break;
267
case self::TYPE_OBJECT:
268
- $output .= 'map[string]interface{}{}';
+ $output .= ($example === '{}')
269
+ ? '{map[string]interface{}{}}'
270
+ : (($formatted = json_encode(json_decode($example, true), JSON_PRETTY_PRINT))
271
+ ? 'map[string]interface{}' . preg_replace('/\n/', "\n ", $formatted)
272
+ : 'map[string]interface{}' . $example);
273
274
case self::TYPE_BOOLEAN:
275
$output .= ($example) ? 'true' : 'false';
0 commit comments