eed3si9n / scalaxb

scalaxb is an XML data binding tool for Scala.
http://scalaxb.org/
MIT License
332 stars 154 forks source link

To enhance scalaxb to generate classes by prepending Family Name by Default instead of using random sequence #641

Open raghutiwari opened 9 months ago

raghutiwari commented 9 months ago

Hello,

I am opening this as an enhancement to include the flag "--prepend-family" in Default config in the file: "src/main/scala/scalaxb/compiler/Config.scala"

At Line: 122.

I am not sure if this is the only fix required but I am raising a PR for the same.

I think if we make this change, it can really boost the functionality of scalaxb as right now from my personal experience, if I add more xsd files to generate, the sequencing just mess up and it becomes a tiresome change plus with the numbering, you even dont know which tag is for which .xsd?

Can we do that?

eed3si9n commented 9 months ago

I am glad that --prepend-family fixed your issue. Are you collapsing various schemas into one package name that necessitated this? Given that there are some users of scalaxb who are using it at work, changing this default value would break their existing code right? Maybe we should create a troubleshooting guide or something to advertise this option, but I don't know if it's worth breaking all of the generated code in this way. A more canonical fix, I think should be to put classes in different pacakges so the name in XML Schema would be the same in Scala.