MCPcopy Create free account
hub / github.com/ElementsProject/lightning / generate_description

Function generate_description

tools/fromschema.py:399–419  ·  view source on GitHub ↗

Generate rpc description with request parameter descriptions

(schema)

Source from the content-addressed store, hash-verified

397
398
399def generate_description(schema):
400 """Generate rpc description with request parameter descriptions"""
401 schema_type = get_schema_type(schema, True)
402 request = schema.get('request', {})
403 properties = request.get('properties', {})
404 output_title('DESCRIPTION')
405 # Add deprecated and removal information for the command
406 if 'deprecated' in schema:
407 output('{} **deprecated in {}, removed after {}**.\n\n'.format(schema_type, schema['deprecated'][0], schema['deprecated'][1] if len(schema['deprecated']) > 1 else deprecated_to_deleted(schema['deprecated'][0])))
408 # Version when the command was added
409 if 'added' in schema and schema['added'] != 'pre-v0.10.1':
410 output('{} *added* in {}.\n\n'.format(schema_type, schema['added']))
411 # Command's detailed description
412 outputs(schema['description'], '\n')
413 # Request parameter's detailed description
414 output('{}'.format('\n\n' if len(properties) > 0 else '\n'))
415
416 if properties:
417 if schema.get('hook'):
418 output_title('HOOK PAYLOAD')
419 output_members(request)
420
421
422def generate_return_value(schema):

Callers 1

mainFunction · 0.85

Calls 7

get_schema_typeFunction · 0.85
output_titleFunction · 0.85
outputFunction · 0.85
deprecated_to_deletedFunction · 0.85
outputsFunction · 0.85
output_membersFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected