openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[Java][Spring][Issue: 18929] fix missing JsonIgnoreProperties import in oneOf interface file

Open ondrej-simon opened this issue 1 year ago • 6 comments

Fixes #18929

@cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09) @martin-mfg (2023/08)

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/configs/*.yaml
    ./bin/utils/export_docs_generators.sh
    
    (For Windows users, please run the script in Git BASH) 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*. IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • [x] File the PR against the correct branch: master (upcoming 7.7.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • [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.

ondrej-simon avatar Jun 14 '24 12:06 ondrej-simon

Can you generate the samples and include as part of this review?

./bin/generate-samples.sh ./bin/configs/*.yaml

welshm avatar Jun 14 '24 13:06 welshm

Hi @welshm , I ran the scripts locally before committing and it lead to no changes within the repository. I assume that was the expected outcome?

I will run them again in the evening, to make sure I did not miss anything.

ondrej-simon avatar Jun 14 '24 13:06 ondrej-simon

Hi @welshm , I ran the scripts locally before committing and it lead to no changes within the repository. I assume that was the expected outcome?

I will run them again in the evening, to make sure I did not miss anything.

I will have to check if there are any samples that include Jackson. If there are, I would expect changes.

welshm avatar Jun 14 '24 15:06 welshm

@welshm , I only got to it today. There were some Jackson samples, anyway I added an example for the scenario I was fixing, and (re)generated the sample files. They are part of the second commit.

ondrej-simon avatar Jun 15 '24 09:06 ondrej-simon

Change LGTM - approved from wrong account 🤦

welshm avatar Jun 16 '24 20:06 welshm

@ondrej-simon thanks for the PR.

can you please PM me via Slack to discuss this PR when you've time ?

https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g

wing328 avatar Jun 26 '24 07:06 wing328

Unfortunately some build checks have failed. Seems like I may have uncovered another bug caused by this complicated scenario, which comes to filename generation.

An interface CreateParkAnimalCarerPersonResponsibleForDtoOneOfDto is generated, but it is placed into CreateParkAnimalCarerPersonResponsibleForDtoOneOfDtoDto.java file, there is "DtoDto" in the file name, twice instead of once, hence why build does not work.

Is it possible to get some assistance with this? I do not know what to look for in the project.

ondrej-simon avatar Jul 01 '24 06:07 ondrej-simon

An interface CreateParkAnimalCarerPersonResponsibleForDtoOneOfDto is generated, but it is placed into CreateParkAnimalCarerPersonResponsibleForDtoOneOfDtoDto.java file, there is "DtoDto" in the file name, twice instead of once, hence why build does not work.

No idea off the top of my head :(

wing328 avatar Jul 11 '24 07:07 wing328

I would see if the MODEL_NAME_SUFFIX is being set in the test and if so, does changing it impact the file name and then try to trace it from there.

codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto");

If I had to guess, it's adding Dto for the when it's generating the model type and then adding Dto again as a model name suffix

Unfortunately some build checks have failed. Seems like I may have uncovered another bug caused by this complicated scenario, which comes to filename generation.

An interface CreateParkAnimalCarerPersonResponsibleForDtoOneOfDto is generated, but it is placed into CreateParkAnimalCarerPersonResponsibleForDtoOneOfDtoDto.java file, there is "DtoDto" in the file name, twice instead of once, hence why build does not work.

Is it possible to get some assistance with this? I do not know what to look for in the project.

welshm avatar Jul 11 '24 14:07 welshm

Closing this PR - explanation by me in the related issue: https://github.com/OpenAPITools/openapi-generator/issues/18929

ondrej-simon avatar Apr 30 '25 12:04 ondrej-simon