Correctly represent schema.StructRepresentation.
@@ -151,8 +151,11 @@ var (
type TypeStruct struct {
anyType
- tupleStyle bool // if true, ReprKind=Array instead of map (and optional fields are invalid!)
+ // n.b. `Fields` is an (order-preserving!) map in the schema-schema;
+ // but it's a list here, with the keys denormalized into the value,
+ // because that's typically how we use it.
fields []StructField
+ representation StructRepresentation
}
type StructField struct {
name string
@@ -161,6 +164,21 @@ type StructField struct {
nullable bool
}
+type StructRepresentation interface{ _StructRepresentation() }
+
+func (StructRepresentation_Map) _StructRepresentation() {}
+func (StructRepresentation_Tuple) _StructRepresentation() {}
+func (StructRepresentation_StringPairs) _StructRepresentation() {}
+func (StructRepresentation_StringJoin) _StructRepresentation() {}
+
+type StructRepresentation_Map struct {
+ renames map[string]string
+ implicits map[string]interface{}
+}
+type StructRepresentation_Tuple struct{}
+type StructRepresentation_StringPairs struct{ sep1, sep2 string }
+type StructRepresentation_StringJoin struct{ sep string }
+
type TypeEnum struct {
anyType
members []string
