@@ -237,26 +237,25 @@ case class DictionaryJsonEncoder(
237
237
jsonWithOptionalValues(json, optionalValues)
238
238
}
239
239
case Symbol .Struct (preA, node, postA) => {
240
- val Type .Struct (_, anonStruct, default, sizes, formats) = dictionaryState.a.typeMap(symbol.getNodeId)
241
- val Type .AnonStruct (members) = anonStruct
240
+ val Type .Struct (_, _, default, sizes, _) = dictionaryState.a.typeMap(symbol.getNodeId)
242
241
val memberFormatMap = node.data.members.flatMap { case (_, memberNode, _) =>
243
242
memberNode.data.format.map(format => memberNode.data.name -> format.data)
244
243
}.toMap
245
244
val memberAnnotationMap = node.data.members.flatMap { case (preA, memberNode, postA) =>
246
245
val annotation = (preA ++ postA).mkString(" \n " )
247
246
if (annotation.isEmpty) None else Some (memberNode.data.name -> annotation)
248
247
}.toMap
249
- val membersFormatted = for (((key, t ), index) <- members.zipWithIndex) yield {
248
+ val membersFormatted = for (((_, m, _ ), index) <- node.data. members.zipWithIndex) yield {
250
249
val json = Json .obj(
251
- " type" -> typeAsJson(t).asJson ,
250
+ " type" -> typeAsJson(dictionaryState.a.typeMap(m.data.typeName.id)) ,
252
251
" index" -> index.asJson
253
252
)
254
253
val optionalValues = Map (
255
- " size" -> sizes.get(key ),
256
- " format" -> memberFormatMap.get(key ),
257
- " annotation" -> memberAnnotationMap.get(key )
254
+ " size" -> sizes.get(m.data.name ),
255
+ " format" -> memberFormatMap.get(m.data.name ),
256
+ " annotation" -> memberAnnotationMap.get(m.data.name )
258
257
)
259
- (key .toString -> jsonWithOptionalValues(json, optionalValues))
258
+ (m.data.name .toString -> jsonWithOptionalValues(json, optionalValues))
260
259
}
261
260
val json = Json .obj(
262
261
" kind" -> " struct" .asJson,
@@ -550,4 +549,4 @@ case class DictionaryJsonEncoder(
550
549
}
551
550
}
552
551
553
- }
552
+ }
0 commit comments