Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature for future] Automatic generation of class hierarchy from xml schema #12

Open
altavir opened this issue Jul 7, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@altavir
Copy link
Contributor

altavir commented Jul 7, 2019

This feature requires some additional work and external tool, but I am putting it here just to track it. It is possible to generate Kotlin class file compatible with kotlinx.serialization from xml schema. We should consider doing it in future. It will also help to cover different use-cases.

@pdvrieze
Copy link
Owner

pdvrieze commented Jul 9, 2019

Of course it would be useful to add the reverse as well (schema from classes). That should be easier to achieve. I'll have to check the state of the code generator (when I have time). The API should support it at this moment, but it was the case that SerialInfo was not implemented completely.

On XML Schema, I'd be happy for some to work, but it is likely that we would be limited to a subset of xml schema. The way it works isn't quite the way that Kotlin/Java type hierarchies work, but supporting a common part of it is certainly possible..

@pdvrieze pdvrieze added the enhancement New feature or request label Jul 9, 2019
@pdvrieze
Copy link
Owner

The just released version actually builds a full representation of the types. This should make the opposite case (schema from code) quite feasible. That is certainly the easier case, but I don't see why this could not also be used to generate kotlin classes for the schema.

@altavir
Copy link
Contributor Author

altavir commented Aug 20, 2020

Schema from classes is also quite useful.

@ComBatVision
Copy link

Hi. Any news about this feature release date?

It will be very useful to have alternative to Java XJC + Krasa plugin in Kotlin multi-platform, to have Kotlin classes with validations and text captions from XSD instead of JAXB + JSR303.
If you require, I can provide good complex XSD example.

@pdvrieze
Copy link
Owner

I haven't started on this (work comes first, especially over adding features). Of course a good example would be helpful, but I don't think that I'll be able to put much time in it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants