-
Notifications
You must be signed in to change notification settings - Fork 6k
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
adding fluent api options to spring java codegen #7056
base: master
Are you sure you want to change the base?
Conversation
this adds two boolean flags simpleFluentPattern and collectionFluentPattern. Both default to true which is the current behavior today.
@UltimateDogg can you detail the problem you have with Jackson ? |
Sure @cbornet. Error was com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of x.x.x.x.L2SwitchInterface: no String-argument constructor/factory method to deserialize from String value ('WAN1') the error seemed to be coming from the fact that there is a field like @JsonProperty("name") and getter and setters of public L2SwitchInterface name(String name) { public String getName() { public void setName(String name) { since there are two setters it seems that jackson is having issues picking which one is the setter. removing the one helped. |
I don’t understand : there’s a mix of name and L2SwitchInterfaceName. Can you provide your swagger spec and the command line used for generation ? |
here is the stripped down area that caused issue with version jackson 2.8.5, but works ok in latest 2.9
basically when i passed WAN1 in the name field it would fail unless i removed the
so i wrote some flags for this |
I just tried the Spring Petstore sample and didn't reproduce your issue. The Pet model has a string property called name just as your snippet. So your issue is something else. Could you share a minimal project reproducing your issue on a github repo ? |
i will try and see about setting up a github project with the exact details. I know that my swagger is about 8 levels deep so i dont know if that had something to do with it. |
i was unable to make a test case. It may be the combination of version / libraries I used or it may have been a transitive issue that was due to environment. The features added do work however so i will leave it up to you if you think there is any value. I can also always reopen if i am able to reproduce in the future. |
this adds two boolean flags simpleFluentPattern and
collectionFluentPattern for the spring language generator. Both default to true which is the current
behavior today. This is probably applicable to anything that is java related but there seems to be a lot of disparate classes that deal with Java. feedback is welcome.
I added these flags as some versions of jackson has issues with multiple setters that take the same input.
@bbdouglas @JFCote @sreeshas @jfiala @lukoyanov @cbornet