amazon-ion / ion-cli

Apache License 2.0
31 stars 15 forks source link

Sequence and scalar nested types should not generate a separate class/struct #110

Closed desaikd closed 2 months ago

desaikd commented 3 months ago

As per the conversation in this PR and offline, it would be simpler to express sequence and scalar nested types as is instead of creating another nested class/struct for it. This will be implemented in a separate PR. Example ISL:

type::{
   name: foo,
   fields: {
      sequence_type: { type: list, element: int },
      scalar_type: { type: string }
   }
}

Output Java:

class Foo {
   private sequence_type: ArrayList<Integer>; // current impl would treat it as `NestedTypeX`
   private scalar_type: String; // current impl would treat it as `NestedTypeY`
   ...
}

Originally posted by @desaikd in https://github.com/amazon-ion/ion-cli/issues/109#issuecomment-2128195270

desaikd commented 2 months ago

Completed with #111