Fixes #4208 (closed)
Thanks to @DenisKnoepfle for the discussion around this bug to help reproduce the underlying issue.
- Updates WorkflowSettings to duplicate the logic which checks for classpath files (previously, would break on Windows, or on all OS if template directory did not match structures in openapi-generator's resource directory)
- Updates java-client.xml in Maven example to allow spot-check of
templateDirectory
property - Fixes classpath check in template manager to work on Windows for paths defined in
templateDir
property of a codegen config - Adds tests for template resource locator
The Maven plugin follows a different flow for template directory versus resource loaded templates. I'd tried reproducing the reported bug, but it seems I was only testing templateDirectory
under git bash so the problems didn't arise. I've tested templateDir
and templateDirectory
under both Mac and Windows, both locally and in a private git repo using workflows for cross-platform checks. This should be good to go, but I'd like to have another set of eyes on it before merge.
cc @OpenAPITools/generator-core-team
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. -
If contributing template-only or documentation-only changes which will change sample output, build the project beforehand. -
Run the shell script ./bin/generate-samples.sh
to update all Petstore samples related to your fix. 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
-
Copy the technical committee to review the pull request if your PR is targeting a particular programming language.