Lines Matching refs:schema
129 def _prettyPrintSchema(self, schema, seen=None, dent=0): argument
144 return _SchemaToStruct(schema, seen, dent=dent).to_str(self._prettyPrintByName)
146 def prettyPrintSchema(self, schema): argument
157 return self._prettyPrintSchema(schema, dent=1)[:-2]
173 def __init__(self, schema, seen, dent=0): argument
189 self.schema = schema
241 def _to_str_impl(self, schema): argument
250 stype = schema.get('type')
252 self.emitEnd('{', schema.get('description', ''))
254 if 'properties' in schema:
255 for pname, pschema in six.iteritems(schema.get('properties', {})):
258 elif 'additionalProperties' in schema:
260 self._to_str_impl(schema['additionalProperties'])
263 elif '$ref' in schema:
264 schemaName = schema['$ref']
265 description = schema.get('description', '')
272 value = schema.get('default', 'True or False')
273 self.emitEnd('%s,' % str(value), schema.get('description', ''))
275 value = schema.get('default', 'A String')
276 self.emitEnd('"%s",' % str(value), schema.get('description', ''))
278 value = schema.get('default', '42')
279 self.emitEnd('%s,' % str(value), schema.get('description', ''))
281 value = schema.get('default', '3.14')
282 self.emitEnd('%s,' % str(value), schema.get('description', ''))
284 self.emitEnd('None,', schema.get('description', ''))
286 self.emitEnd('"",', schema.get('description', ''))
288 self.emitEnd('[', schema.get('description'))
291 self._to_str_impl(schema['items'])
314 return self._to_str_impl(self.schema)