You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Item type for array property 'listFta' is incorrectly named ListFtum #1275
It looks like duplicate of #148.
As a workaround You could use the javaType extension property to override the class name chosen by the inflector as suggested here: #148 (comment)
Example:
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 javaType or javaName inside the items schema.
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:
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
changed the title [-]Rename array item java "ta" to "tum"[/-][+]Item type for array property 'listFta' is incorrectly named ListFtum[/+]on Jun 30, 2021
Activity
unkish commentedon Jun 23, 2021
Hi
It looks like duplicate of #148.
As a workaround You could use the
javaTypeextension property to override the class name chosen by the inflector as suggested here: #148 (comment)Example:
joelittlejohn commentedon Jun 23, 2021
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
javaTypeorjavaNameinside the items schema.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:
which produces these two rules:
but we should split this like:
so that we get these two rules instead:
qgiodau commentedon Jun 23, 2021
ok, i will use javaName as suggested.
thank you.
unkish commentedon Jun 27, 2021
@joelittlejohn would it be possible to elaborate a bit on what is meant by very specific configuration ?
eirnym commentedon Jun 27, 2021
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
[-]Rename array item java "ta" to "tum"[/-][+]Item type for array property 'listFta' is incorrectly named ListFtum[/+]joelittlejohn commentedon Jun 30, 2021
Closed by #1276