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

[Java] Do not generate setter method for readonly properties #2206

Merged
merged 2 commits into from
Feb 23, 2016
Merged

[Java] Do not generate setter method for readonly properties #2206

merged 2 commits into from
Feb 23, 2016

Conversation

xhh
Copy link
Contributor

@xhh xhh commented Feb 22, 2016

Updated Java clients: default, feign, jersey2, okhttp-gson.

@hiveship
Copy link
Contributor

I will also add it to CXF Codegen :)
I also think that if property is 'readOnly: true' we can declare it as 'final'. Are you ok with me @xhh ?

@ePaul
Copy link
Contributor

ePaul commented Feb 22, 2016

Note that readOnly for a Swagger property just means that the client shouldn't send it to the server, but the server can send it back.
So please make sure it doesn't remove the setter when generating server models.

@hiveship
Copy link
Contributor

Ok sorry @ePaul . I won't remove the setter in the CXF Codegen since it only generates a server stub :)

@wing328
Copy link
Contributor

wing328 commented Feb 23, 2016

FYI. The change applies to retrofit and retrofit2 as well.

cc @cbornet

wing328 added a commit that referenced this pull request Feb 23, 2016
[Java] Do not generate setter method for readonly properties
@wing328 wing328 merged commit 0520e68 into swagger-api:master Feb 23, 2016
@xhh xhh deleted the java-readonly branch February 23, 2016 09:22
@wing328
Copy link
Contributor

wing328 commented Feb 26, 2016

Upgrade note from 2.1.5 to 2.1.6

Starting from 2.1.6, there will be no setter for readOnly attribute in Java models.

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

Successfully merging this pull request may close these issues.

4 participants