File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,19 @@ func (c *CommonInserter) tryParseDate(item map[string]interface{}) map[string]in
68
68
func (c * CommonInserter ) setRefs (item map [string ]interface {}) map [string ]interface {} {
69
69
for k , v := range item {
70
70
switch vt := v .(type ) {
71
+ case map [string ]interface {}:
72
+ for vtk , vtv := range vt {
73
+ if strings .HasPrefix (vtk , "$" ) {
74
+ refID := strings .TrimPrefix (vtk , "$" )
75
+ rk , ok := c .refIDs [refID ]
76
+ if ! ok {
77
+ log .Printf ("%s was not found" , refID )
78
+ continue
79
+ }
80
+ vt [rk ] = vtv
81
+ delete (vt , vtk )
82
+ }
83
+ }
71
84
case string :
72
85
if strings .HasPrefix (vt , "$" ) {
73
86
refID := strings .TrimPrefix (vt , "$" )
Original file line number Diff line number Diff line change
1
+ {
2
+ "versions" : " 1.0" ,
3
+ "items" : [
4
+ {
5
+ "ref" : " Option__dummy_0" ,
6
+ "payload" : {
7
+ "name" : " 選択肢0"
8
+ }
9
+ },
10
+ {
11
+ "ref" : " Option__dummy_1" ,
12
+ "payload" : {
13
+ "name" : " 選択肢1"
14
+ }
15
+ }
16
+ ]
17
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "version" : " 1.0" ,
3
+ "items" : [
4
+ {
5
+ "ref" : " Foo__dummy_0" ,
6
+ "payload" : {
7
+ "defaultOption" : " $Option__dummy_0" ,
8
+ "options" : {
9
+ "$Option__dummy_0" : true ,
10
+ "$Option__dummy_1" : true
11
+ }
12
+ }
13
+ }
14
+ ]
15
+ }
You can’t perform that action at this time.
0 commit comments