Skip to content

[Java][Client] Add Deprecated annotation#6166

Merged
wing328 merged 1 commit intoswagger-api:masterfrom
hisener:java-deprecated-annotation
Jul 25, 2017
Merged

[Java][Client] Add Deprecated annotation#6166
wing328 merged 1 commit intoswagger-api:masterfrom
hisener:java-deprecated-annotation

Conversation

@hisener
Copy link
Contributor

@hisener hisener commented Jul 25, 2017

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master for non-breaking changes and 3.0.0 branch for breaking (non-backward compatible) changes.

Description of the PR

Add @Deprecated annotations to generated Java clients.

@hisener hisener changed the title [Java] Add Deprecated annotation [Java][Client] Add Deprecated annotation Jul 25, 2017
@hisener hisener force-pushed the java-deprecated-annotation branch from 005fb9e to c13283f Compare July 25, 2017 12:05
@wing328
Copy link
Contributor

wing328 commented Jul 25, 2017

@hisener thanks for adding support for deprecated 👍

@wing328 wing328 merged commit 7696ca1 into swagger-api:master Jul 25, 2017
@hisener hisener deleted the java-deprecated-annotation branch July 25, 2017 17:23
@brian-byungsookim
Copy link
Contributor

Is there a reason this PR only added the @Deprecated tag in the javadoc and not as an actual method annotation?

@hisener
Copy link
Contributor Author

hisener commented Oct 24, 2017

@Deprecated is the actual method annotation. @deprecated is related with javadoc. I haven't added the javadoc annotation because deprecated field is boolean in swagger and does not contain any message.

https://docs.oracle.com/javase/tutorial/java/annotations/predefined.html

@brian-byungsookim
Copy link
Contributor

I understand the difference between @Deprecated and @deprecated and I know that the deprecated field in OAS 2.0 is a boolean.

I'm confused as to what you mean by 'I haven't added the javadoc annotation' when the .mustache files changed in this PR all have the @Deprecated annotation in the javadoc, and none as actual method annotations. Could you clarify for me? (I'll leave comments on the changed files)

{{/returnType}}
* @throws ApiException if fails to make API call
{{#isDeprecated}}
* @Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hisener Isn't this a javadoc comment and not an annotation because the line starts with *?

{{/returnType}}
* @throws ApiException if fails to make API call
{{#isDeprecated}}
* @Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

* @return {{{returnType}}}{{/returnType}}
* @throws ApiException if fails to make API call
{{#isDeprecated}}
* @Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@hisener
Copy link
Contributor Author

hisener commented Oct 24, 2017

Yes, I see now. You are right.

@brian-byungsookim
Copy link
Contributor

Ah okay, thanks for clarifying! I've worked on some of the changes and just wanted to confirm, so I can probably just submit a PR soon.

brian-byungsookim added a commit to brian-byungsookim/swagger-codegen that referenced this pull request Oct 24, 2017
wing328 pushed a commit that referenced this pull request Oct 25, 2017
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.

3 participants

Comments