author command: replace \ by /, fix #9528 (#15861)

* author command: replace \ by /

* add windows test for author template
This commit is contained in:
martin-mfg 2023-06-27 04:28:01 +02:00 committed by GitHub
parent e8fc4d159e
commit debf92fd7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -47,6 +47,11 @@ jobs:
run: ./mvnw clean --no-snapshot-updates --batch-mode --quiet install
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
- name: Test Template Retrieval
run: |
cd modules/openapi-generator-cli/target
# generator names containing "-" caused problems in the past, see https://github.com/OpenAPITools/openapi-generator/issues/9528
java -jar ./openapi-generator-cli.jar author template --verbose -g jaxrs-spec --library quarkus
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Gradle tests

View File

@ -45,7 +45,7 @@ public class AuthorTemplate extends OpenApiGeneratorCommand {
@Override
void execute() {
CodegenConfig config = CodegenConfigLoader.forName(generatorName);
String templateDirectory = config.templateDir();
String templateDirectory = config.templateDir().replace('\\', '/');
log("Requesting '{}' from embedded resource directory '{}'", generatorName, templateDirectory);