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=0)[:-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 properties = schema.get("properties", {})
260 elif "additionalProperties" in schema:
262 self._to_str_impl(schema["additionalProperties"])
265 elif "$ref" in schema:
266 schemaName = schema["$ref"]
267 description = schema.get("description", "")
274 value = schema.get("default", "True or False")
275 self.emitEnd("%s," % str(value), schema.get("description", ""))
277 value = schema.get("default", "A String")
278 self.emitEnd('"%s",' % str(value), schema.get("description", ""))
280 value = schema.get("default", "42")
281 self.emitEnd("%s," % str(value), schema.get("description", ""))
283 value = schema.get("default", "3.14")
284 self.emitEnd("%s," % str(value), schema.get("description", ""))
286 self.emitEnd("None,", schema.get("description", ""))
288 self.emitEnd('"",', schema.get("description", ""))
290 self.emitEnd("[", schema.get("description"))
293 self._to_str_impl(schema["items"])
316 return self._to_str_impl(self.schema)