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

POJO property not included in generated swagger #2806

Open
proactif opened this issue Dec 6, 2024 · 0 comments
Open

POJO property not included in generated swagger #2806

proactif opened this issue Dec 6, 2024 · 0 comments

Comments

@proactif
Copy link

proactif commented Dec 6, 2024

The generated swagger for a controller taking a pojo parameter with a name like "aProperty" will not be correctly generated.
The aProperty field will be missing.

This is due to this code in MethodParameterPojoExtractor :

return Stream.of(Introspector.getBeanInfo(paramClass).getPropertyDescriptors())
.filter(d -> d.getName().equals(field.getName()))
...

d.getName() is "AProperty", but field.getName() is "aProperty".
The property is filtered out.

This happens for any field having its first camel case part of length 1.
Which seems to be an edge case of the java beans specification.
(see Introspector.decapitalize())

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

No branches or pull requests

1 participant