|
295 | 295 | then std.get(arg.schema, 'type', '') |
296 | 296 | else std.get(arg, 'type', ''); |
297 | 297 | if std.isArray(type) |
298 | | - then std.join(',', [t for t in type]) |
299 | | - else type, |
| 298 | + then std.join(',', ['`%s`' % t for t in std.set(type)]) |
| 299 | + else '`%s`' % type, |
300 | 300 |
|
301 | 301 | // Use BelRune as default can be 'null' as a value. Only supported for arg.schema, arg.default didn't support this, not sure how to support without breaking asssumptions downstream. |
302 | 302 | local BelRune = std.char(7), |
|
318 | 318 | then [] |
319 | 319 | else d, |
320 | 320 |
|
| 321 | + local manifest(value) = |
| 322 | + std.manifestJsonEx(value, '', '', ': '), |
| 323 | + |
321 | 324 | args: |
322 | 325 | std.join(', ', [ |
323 | 326 | local default = getDefault(arg); |
324 | 327 | if default != BelRune |
325 | 328 | then std.join('=', [ |
326 | 329 | arg.name, |
327 | | - std.manifestJson(default), |
| 330 | + manifest(default), |
328 | 331 | ]) |
329 | 332 | else arg.name |
330 | 333 | for arg in doc['function'].args |
|
336 | 339 | then |
337 | 340 | '\nPARAMETERS:\n\n' |
338 | 341 | + std.join('\n', [ |
339 | | - '* **%s** (`%s`)' % [arg.name, getType(arg)] |
| 342 | + '* **%s** (%s)' % [arg.name, getType(arg)] |
340 | 343 | + ( |
341 | 344 | local default = getDefault(arg); |
342 | 345 | if default != BelRune |
343 | | - then '\n - default value: `%s`' % std.manifestJson(default) |
| 346 | + then '\n - default value: `%s`' % manifest(default) |
344 | 347 | else '' |
345 | 348 | ) |
346 | 349 | + ( |
|
349 | 352 | then |
350 | 353 | '\n - valid values: %s' % |
351 | 354 | std.join(', ', [ |
352 | | - '`%s`' % std.manifestJson(item) |
| 355 | + '`%s`' % manifest(item) |
353 | 356 | for item in enum |
354 | 357 | ]) |
355 | 358 | else '' |
|
0 commit comments