Closed desaikd closed 6 months ago
Having a user-provided namespace solves the problem of multiple different generated models having conflicts because they have the same namespace. However, it doesn't solve the fact that you could have something like this example where there are a total for 4 types (this one and 3 inline-imported types) that all have the same name.
type::{
name: type_definition,
one_of: [
{ id: "ion_schema_1_0.isl", type: type_definition },
{ id: "ion_schema_2_0.isl", type: type_definition },
{ id: "ion_schema_2_1.isl", type: type_definition },
]
}
We need to have schema-derived namespaces (for all languages) and the option for the user to provide a namespace root (for at least some languages).
With the CLI option namespace
for Java and single module for Rust code generation this issue is resolved: https://github.com/amazon-ion/ion-cli/pull/94
Currently module names are hard-coded for the import statements in the generated code, this needs to be dynamic based on module path provided by user.