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][Client] Support annotationLibrary=none #12422

Closed

Conversation

cachescrubber
Copy link
Contributor

@cachescrubber cachescrubber commented May 21, 2022

Support annotationLibrary=none

effectively removes swagger 1 from the java clients. Fallback is available using annotationLibrary=swagger1.

Relates to

PR checklist

  • [x ] Read the contribution guidelines.
  • [ x] Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • [ x] Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • [x ] If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10)

@welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02)

@cachescrubber cachescrubber mentioned this pull request May 21, 2022
4 tasks
Copy link
Member

@borsch borsch left a comment

Choose a reason for hiding this comment

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

Java related changes looks good to me, but seems likes you did/pull some unrelated to java changes

@cachescrubber
Copy link
Contributor Author

but seems likes you did/pull some unrelated to java changes

This is related to #12424. I had to re-generate all model tests because stale model test classes in the samples caused the build to fail.

@mgohin
Copy link

mgohin commented Jun 23, 2022

Any updates ?

@wing328
Copy link
Member

wing328 commented Jul 6, 2022

Can you please resolve the merge conflicts when you've time?

# Conflicts:
#	modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache
#	samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java
#	samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ChildCat.java
#	samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java
#	samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java
#	samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java
#	samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java
#	samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java
#	samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/resteasy/pom.xml
#	samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/BigCat.java
#	samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/CatAllOfTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/DeprecatedObjectTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/DogAllOfTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/FooTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/HealthCheckResultTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/NullableClassTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/ObjectWithDeprecatedFieldsTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumDefaultValueTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerDefaultValueTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumIntegerTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterObjectWithEnumPropertyTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php
#	samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php
#	samples/client/petstore/python/test/test_child.py
#	samples/client/petstore/python/test/test_dog.py
#	samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/ChildSchema.java
#	samples/openapi3/client/petstore/java/jersey2-java8-special-characters/src/main/java/org/openapitools/client/model/MySchemaNameCharacters.java
#	samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ChildCat.java
#	samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java
#	samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java
#	samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java
#	samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java
#	samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java
@cachescrubber
Copy link
Contributor Author

@wing328 I finally managed to bring this up to date.

@floka94
Copy link

floka94 commented Sep 12, 2022

Hey Guys, any updates here @wing328 ? Looking forward to the feature ❤️

# Conflicts:
#	modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache
#	modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache
#	samples/client/others/java/okhttp-gson-streaming/pom.xml
#	samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml
#	samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml
#	samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml
#	samples/client/petstore/java/okhttp-gson/pom.xml
#	samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1.java
#	samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/JSONTest.java
#	samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java
#	samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ArrayOfInlineAllOfArrayAllofDogPropertyInnerAllOf1Test.java
#	samples/client/petstore/java/vertx-no-nullable/pom.xml
#	samples/client/petstore/java/vertx/pom.xml
# Conflicts:
#	samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/PetTest.java
@cachescrubber
Copy link
Contributor Author

@wing328 I once again brought this up to date, please review.

@wing328
Copy link
Member

wing328 commented Oct 31, 2022

Looks like lots of test files were removed, e.g. samples/client/petstore/java/jersey3/src/test/java/org/openapitools/client/JSONComposedSchemaTest.java

did you purge all the samples folders and regenerate samples?

@wing328 wing328 added this to the 6.2.1 milestone Oct 31, 2022
@cachescrubber
Copy link
Contributor Author

did you purge all the samples folders and regenerate samples?

Yes, I purged all generated samples and re-created them. I did that because generated tests are never re-generated. Since I removed the swagger 1 dependency, the tests would no longer compile.

@cachescrubber
Copy link
Contributor Author

@wing328 See #13869. We need to sort out the generated test code issue there.

@wing328
Copy link
Member

wing328 commented Nov 1, 2022

Will continue to work on #13869 (already pushed 2 commits to clean up java feign sample)

Closing this one for the time being.

@wing328 wing328 closed this Nov 1, 2022
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

5 participants