def _formatSchema(data, incoming):
 if incoming:
  param = '<json'
 else:
  param = '>json'
 if (data['type'] == 'array'):
  param += 'arr'
 for (prop, attr) in sorted(data[u'properties'].iteritems()):
  if attr['required']:
   required = '*(required)* '
  else:
   required = ''
  if isinstance(attr['type'], list):
   types = '|'.join(attr['type'])
  else:
   types = attr['type']
  (yield (':%s %s %s: %s%s' % (param, types, prop, required, attr['title'])))
  (yield '')
  for line in attr['description']:
   (yield ('   ' + line))

def _formatSchema ( data , incoming ) : if incoming : param = '<json' else : param = '>json' if ( data [ 'type' ] == 'array' ) : param += 'arr' for ( prop , attr ) in sorted ( data [ u'properties' ] . iteritems ( ) ) : if attr [ 'required' ] : required = '*(required)* ' else : required = '' if isinstance ( attr [ 'type' ] , list ) : types = '|' . join ( attr [ 'type' ] ) else : types = attr [ 'type' ] ( yield ( ':%s %s %s: %s%s' % ( param , types , prop , required , attr [ 'title' ] ) ) ) ( yield '' ) for line in attr [ 'description' ] : ( yield ( '   ' + line ) )
generate the rst associated to a json schema .