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][Micronaut] generator fixes #11803

Merged
merged 8 commits into from
May 20, 2022
Merged

Conversation

oujesky
Copy link
Contributor

@oujesky oujesky commented Mar 4, 2022

Minor fixes for Micronaut generator:

  • fixed hardcoded package name for import
  • fixed @Consumes and @Produces annotations
  • fixed security schemes pairing when dots (or other "special" char) is present

cc @andriy-dmytruk

PR checklist

  • Read the contribution guidelines.
  • 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.
  • 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.
  • File the PR against the correct branch: master (5.3.0), 6.0.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.

@andriy-dmytruk
Copy link
Contributor

Hi @oujesky, all the changes are reasonable and make sense. Thank you for this PR.
Please do run integration tests for micronaut. You can for example use these commands to rebuild and run:

./mvnw clean package -DskipTests
./mvnw package integration-test -P java-micronaut-client -P java-micronaut-server

I have noticed that there are some errors for the generated micronaut client as a sample.
To fix them you will probably need to add this dependency in samples/client/petstore/java-micronuat-client:

  <dependency>
    <groupId>io.micronaut.xml</groupId>
    <artifactId>micronaut-jackson-xml</artifactId>
    <scope>compile</scope>
  </dependency>

The other error I encountered is that xml of empty list gets parsed as [""] (list with empty string). Not sure how to fix that. You can annotate the test with @Ignore for now and write another one that doesn't use an empty list if you don't find another solution.

@wing328
Copy link
Member

wing328 commented Apr 12, 2022

@oujesky can you please resolve the merge conflicts when you've time?

@@ -74,6 +75,7 @@ class PetApiSpec extends Specification {
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
*/
@Ignore("Issue reported in https://github.com/micronaut-projects/micronaut-jackson-xml/issues/175")
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: This and the next test failed because of the issue reported in micronaut-projects/micronaut-jackson-xml#175:
phototoUrls is an empty set, but is deserialized as set with an empty String ([""]). No changes are required on the openapi generator side.

Copy link
Contributor

@andriy-dmytruk andriy-dmytruk left a comment

Choose a reason for hiding this comment

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

Tested locally. LGTM

@wing328 wing328 merged commit 3f788d3 into OpenAPITools:master May 20, 2022
samuelo added a commit to Capitolis/openapi-generator that referenced this pull request May 22, 2022
* master:
  update gson to newer version in kotlin templates (OpenAPITools#12425)
  update gson to 2.8.9 in android httpclient (OpenAPITools#12423)
  update android dependencies to newer versions (OpenAPITools#12421)
  [Java] Update rest-assured dependencies (OpenAPITools#12420)
  update cwiki samples
  Add - Status colors in Wiki, Example per parameter (OpenAPITools#12394)
  Better support for inline schemas in parameters (OpenAPITools#12369)
  Upgrade Spring Boot to 2.5.14 / 2.7.0 (OpenAPITools#12408)
  update java samples
  Remove javadoc comment for unthrown IOException (OpenAPITools#12401)
  remove errorObjectSubtype from java client genreator (OpenAPITools#12405)
  [java][Micronaut] generator fixes (OpenAPITools#11803)
  Apply style and explode values from encoding for form-encoded request body parameters (OpenAPITools#12162)
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