-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Item type for array property 'listFta' is incorrectly named ListFtum #1275
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
Comments
Hi It looks like duplicate of #148.
|
Yes, so the issue here is that when we see an array like 'Products' we make this singular for the item class name, like 'Product'. For words that end in 'ta' (like data) the singular noun ends in 'tum' (like datum). So the inflector class (the class responsible for producing these singular nouns) is a little over-zealous. I don't really like #148 because it encourages a very specific configuration. It would probably be better to add a config option to disable the inflector. As unkish has said though, for now you should be able to work around this using In the past it has still been useful to add and fix rules in the inflector when we find problems. In this case, it should have a more specific rule I think. The code currently has: .singular("([ti])a$", "$1um") which produces these two rules:
but we should split this like: .singular("ia$", "ium")
.singular("ata$", "atum") so that we get these two rules instead:
|
ok, i will use javaName as suggested. thank you. |
@joelittlejohn would it be possible to elaborate a bit on what is meant by very specific configuration ? |
The best implementation I'd see here is make this endings modifications being possible to override by a jsonschema2pojo plugin like for types. In this case everyone can modify default behavior as it suits best to a project |
Closed by #1276 |
Hi, when i use the following schema:
The Foo java class generated, has got a property listFtum instead of listFta:
@JsonProperty("listFta") @Valid private List<ListFtum> listFta = null;
I use the maven plugin for the code generation , but also from website https://www.jsonschema2pojo.org/ , the result is the same.
Can you help me?
Best regards.
Thank you.
The text was updated successfully, but these errors were encountered: