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
Enum classes are duplicated and corrupt #351
Comments
@TedZen PLS check this |
I've experienced the same issue. I believe it's due to this line: JsonToKotlinClass/src/main/kotlin/wu/seal/jsontokotlin/model/builder/KotlinEnumCodeBuilder.kt Line 37 in aabaa6a
I think it should read: But I'm not certain. I was planning on cloning the repo and seeing whether that'd fix it later, but if someone more familiar can look at that and be like "ah, yes" that'd be awesome. |
After checking out the repo and poking around I realize my previous thought was incorrect, however in looking at the test code
I realized that JsonToKotlinClass expects A solution that worked for me was to add escaped quotations into the enum fields. I'm not sure whether this conforms to json schema spec. Example using the schema from the test code:
Produces
|
Hi,
I am trying to use your project as a lib to generate our API classes from a json schema.
I ran into the following problem:
When there is an enum in the class, I could see 2 problems:
Example:
I have a json schema:
I would expect the following code to come out of this:
but I get:
Unfortunately this does not compile with the following errors:
Duplicate JVM class name 'de/europace/privatkredit/kex/vorgaenge/api/Foo1$FooEnum' generated from: FooEnum, FooEnum
Type mismatch. Required:String, Found:Foo1.FooEnum
I am currently using the lib
wu.seal.jsontokotlin:library:3.6.1
My generation code:
The text was updated successfully, but these errors were encountered: