-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Objects inside array with name ending with "List" are generated as "SomeNameList" #780
Comments
Hi Devin. You can use javaType in this situation. It will allow you to choose the class name you want for Thing. |
Thanks for pointing out that feature (I failed to RTFM). That suites my needs. As "SomethingList" is fairly common, thoughts on making the name happen automatically? Feel free to close if it's not a feature you think is valuable. Thanks again! |
You've probably seen this already, but just in case you haven't, another option is calling the array I'm going to tentatively close this one because we get a lot of issues raised where people don't like the heuristics we use to decide a better item class name, and I don't want to create more of that. If others chime in on this ticket then maybe we can think about adding this. All the same, thanks for raising this! |
I have the same problem, but my source is from JSON , not from JSON Schema Is there any workaround for me to generate List<Thing> for thingList instead of List<ThingList> ? |
Example schema
Output
This generates two class files:
ExampleListSchema.class
andThingList.class
ExampleListSchema
contains propertythingList
which is aList<ThingList>
.Expected
I was expecting two class files:
ExampleListSchema.class
andThing.class
ExampleListSchema
would contain propertythingList
which would be aList<Thing>
While it is debatable whether the "somethingList" naming pattern is "good", it is a fairly common practice. I would really appreciate support for it in this project.
The class files will parse everything as expected, so this is just a minor inconvenience where a class named "List" isn't actually a list.
The text was updated successfully, but these errors were encountered: