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

Function output_array

tools/fromschema.py:197–217  ·  view source on GitHub ↗

We've already said it's an array of {type}

(items, indent)

Source from the content-addressed store, hash-verified

195
196
197def output_array(items, indent):
198 """We've already said it's an array of {type}"""
199 if not isinstance(items, dict) or items == {}:
200 output(indent + '- (any type)\n')
201 return
202
203 if 'oneOf' in items and isinstance(items['oneOf'], list):
204 output_members(items, indent + ' ')
205 elif items.get('type') == 'object':
206 output_members(items, indent)
207 elif items.get('type') == 'array':
208 output(indent + '-')
209 output_type(items, False)
210 output(': {}\n'.format(esc_underscores('\n'.join(items['description']))) if 'description' in items and len(items['description']) > 0 else '\n')
211 if 'items' in items:
212 output_array(items['items'], indent + ' ')
213 else:
214 if 'type' in items:
215 output_member(None, items, True, indent)
216 else:
217 output(indent + '- (any type)\n')
218
219
220def has_members(sub):

Callers 2

output_memberFunction · 0.85
output_membersFunction · 0.85

Calls 7

outputFunction · 0.85
output_membersFunction · 0.85
esc_underscoresFunction · 0.85
output_memberFunction · 0.85
joinMethod · 0.80
output_typeFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected