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] & [generator-code] Forbiddenapis check and fix #672

Merged
merged 7 commits into from
Aug 22, 2018
Merged

[java] & [generator-code] Forbiddenapis check and fix #672

merged 7 commits into from
Aug 22, 2018

Conversation

burberius
Copy link
Contributor

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, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
    @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01)

Description of the PR

I used the forbiddenapis maven plugin with code generated by openapi codegen and it found some problems.
So I added the plugin to the openapi-generator parent pom, ran the checks there and fixed all findings.
In all java templates I also fixed the findings and generated the samples to check it.

You can read more about the found problems in this article:
https://dzone.com/articles/policemans-horror-default

@jeff9finger
Copy link
Contributor

This seems like a good idea.

@wing328
Copy link
Member

wing328 commented Jul 31, 2018

@burberius thanks for the PR 👍

@jeff9finger thanks for reviewing the change.

If no further feedback or question, I'll merge it on coming Wed.

@wing328 wing328 modified the milestones: 3.2.0, 3.2.1 Jul 31, 2018
@wing328 wing328 modified the milestones: 3.2.1, 3.2.2 Aug 14, 2018
@wing328
Copy link
Member

wing328 commented Aug 21, 2018

@burberius I wonder if you can resolve the merge conflicts and then I'll merge it into master.

Sorry for taking a bit long to review the change.

# Conflicts:
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ApexClientCodegen.java
#	modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ErlangClientCodegen.java
#	pom.xml
@jmini
Copy link
Member

jmini commented Aug 21, 2018

I have merged develop into this branch (incl solving merge conflicts) => c73dbbb
I have fixed the new "forbiddenapis" checks introduced by changes made on master => 79f38bf


Because the change introduce a new check, it would be great to merge master into this pr before doing the "Squash and merge" to ensure that the changes on master are not breaking the build once this PR is "Squashed and merged".

@jmini jmini merged commit 9bc335b into OpenAPITools:master Aug 22, 2018
@jmini jmini changed the title Forbiddenapis check and fix [java] & [generator-code] Forbiddenapis check and fix Aug 22, 2018
@wing328
Copy link
Member

wing328 commented Aug 22, 2018

@burberius thanks for the fix, which is included in the v3.2.2 stable release: https://twitter.com/oas_generator/status/1032252335131512832

A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* Added forbiddenapis check and fixed the findings in the normal code
* Fixed forbiddenapi findings in java templates and samples.
* Generated all samples for Java.
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.

None yet

4 participants