code: func Generate(schema *rdl.Schema) (JSONSchema, error) {
  	reg := rdl.NewTypeRegistry(schema)
  	js := make(JSONSchema) //map[string]interface{})
  	js["$schema"] = "http://json-schema.org/draft-04/schema#"
  	if len(schema.Types) > 0 {
  		defs := make(map[string]map[string]interface{})
  		js["definitions"] = defs
  		for _, t := range schema.Types {
  			ref := jsTypeDef(reg, t)
  			if ref != nil {
  				tName, _, _ := rdl.TypeInfo(t)
  				defs[string(tName)] = ref
  			}
  		}
  	}
  	return js, nil
  }
docs: //always generates schemas of the form {"definitions": { ... }}, unless no types are defined at all, then just {}