func returnsToSchema(pidl *idl.Idl, t *idl.Type) *swagger2.Schema { sc := new(swagger2.Schema) // sc.Title = f.Name if t.IsVoid() { // nil schema means the operation returns no content return nil } else { it := typeToItems(pidl, t) sc.Ref = it.Ref sc.Type = it.Type sc.Format = it.Format sc.ItemsDef.Items = it.Items sc.Enum = it.Enum sc.AdditionalProperties = it.AdditionalProperties } return sc }
// formatType returns the Type as a string in format suitable for C#. func (gen *goGenerator) formatType(t *idl.Type) string { var s string ms, ok := goTypes[t.Name] if !ok { ms = t.Name } if t.IsList() { s = fmt.Sprintf(ms, gen.formatType(t.ValueType)) } else if t.IsMap() { s = fmt.Sprintf(ms, goTypes[t.KeyType.Name], gen.formatType(t.ValueType)) } else if t.IsBinary() { s = ms } else if t.IsPrimitive() { s = "*" + ms } else if t.IsEnum(gen.tplRootIdl) { s = "*" + ms } else if t.IsVoid() { s = "" } else { s = "*" + ms } return s }
func (gen *javaGenerator) isVoid(t *idl.Type) bool { return t.IsVoid() }
func (gen *csharpGenerator) isVoid(t *idl.Type) bool { return t.IsVoid() }