Skip to content

Conversation

@jcjveraa
Copy link
Contributor

@jcjveraa jcjveraa commented Jun 12, 2025

Fix #1047

Many thanks for submitting your Pull Request ❤️!

Please make sure that your PR meets the following requirements:

  • You have read the contributors guide
  • Your code is properly formatted according to our code style
  • Pull Request title contains the target branch if not targeting main: [0.9.x] Subject
  • Pull Request contains link to the issue
  • Pull Request contains link to any dependent or related Pull Request
  • Pull Request contains description of the issue
  • Pull Request does not include fixes for issues other than the main ticket
This fixes issues with generating openapi spec 3.1.0 versions on Windows, e.g. #1047

Please backport this to the main LTS release as well - I don't seem to be able to set a label?
I've tested this on my own simple project.

https://github.com/jcjveraa/quarkus-openapi-generator-demoapp

Without this fix (on windows on version 2.10.0-lts): java.net.URISyntaxException: Illegal character in opaque part at index 2: C:(...)
With (on local build of 3.0.0-SNAPSHOT): it works fine.

No tests added

@jcjveraa jcjveraa marked this pull request as ready for review June 12, 2025 14:19
@jcjveraa jcjveraa requested a review from a team as a code owner June 12, 2025 14:19
@jcjveraa
Copy link
Contributor Author

jcjveraa commented Jun 12, 2025

ref https://github.com/jcjveraa/quarkus-openapi-generator-demoapp
On version 2.10.0-lts on windows 11:

C:\Users\veraj00\.jdks\temurin-17.0.15\bin\java.exe -Dmaven.multiModuleProjectDirectory=C:\ws\git\demo -Djansi.passthrough=true -Dmaven.home=C:\Users\veraj00\.m2\wrapper\dists\apache-maven-3.9.9-bin\4nf9hui3q3djbarqar9g711ggc\apache-maven-3.9.9 -Dclassworlds.conf=C:\Users\veraj00\.m2\wrapper\dists\apache-maven-3.9.9-bin\4nf9hui3q3djbarqar9g711ggc\apache-maven-3.9.9\bin\m2.conf "-Dmaven.ext.class.path=C:\Users\veraj00\AppData\Local\Programs\IntelliJ IDEA Ultimate\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Users\veraj00\AppData\Local\Programs\IntelliJ IDEA Ultimate\lib\idea_rt.jar=56049" -Dfile.encoding=UTF-8 -classpath C:\Users\veraj00\.m2\wrapper\dists\apache-maven-3.9.9-bin\4nf9hui3q3djbarqar9g711ggc\apache-maven-3.9.9\boot\plexus-classworlds-2.8.0.jar;C:\Users\veraj00\.m2\wrapper\dists\apache-maven-3.9.9-bin\4nf9hui3q3djbarqar9g711ggc\apache-maven-3.9.9\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2025.1.2 compile
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------------< com.example:demo >--------------------------
[INFO] Building demo 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ demo ---
[INFO] Copying 1 resource from src\main\resources to target\classes
[INFO] 
[INFO] --- quarkus:3.23.3:generate-code (default) @ demo ---
[INFO] Generating with dryRun=false
[ERROR] Error resolving schema #/components/schemas/Pet
java.net.URISyntaxException: Illegal character in opaque part at index 2: C:\ws\git\demo\src\main\openapi\petstore.json
    at java.net.URI$Parser.fail (URI.java:2976)
    at java.net.URI$Parser.checkChars (URI.java:3147)
    at java.net.URI$Parser.parse (URI.java:3183)
    at java.net.URI.<init> (URI.java:623)

On 3.0.0-SNAPSHOT

C:\Users\veraj00\.jdks\temurin-17.0.15\bin\java.exe -Dmaven.multiModuleProjectDirectory=C:\ws\git\demo -Djansi.passthrough=true -Dmaven.home=C:\Users\veraj00\.m2\wrapper\dists\apache-maven-3.9.9-bin\4nf9hui3q3djbarqar9g711ggc\apache-maven-3.9.9 -Dclassworlds.conf=C:\Users\veraj00\.m2\wrapper\dists\apache-maven-3.9.9-bin\4nf9hui3q3djbarqar9g711ggc\apache-maven-3.9.9\bin\m2.conf "-Dmaven.ext.class.path=C:\Users\veraj00\AppData\Local\Programs\IntelliJ IDEA Ultimate\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Users\veraj00\AppData\Local\Programs\IntelliJ IDEA Ultimate\lib\idea_rt.jar=56104" -Dfile.encoding=UTF-8 -classpath C:\Users\veraj00\.m2\wrapper\dists\apache-maven-3.9.9-bin\4nf9hui3q3djbarqar9g711ggc\apache-maven-3.9.9\boot\plexus-classworlds-2.8.0.jar;C:\Users\veraj00\.m2\wrapper\dists\apache-maven-3.9.9-bin\4nf9hui3q3djbarqar9g711ggc\apache-maven-3.9.9\boot\plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2025.1.2 compile
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------------< com.example:demo >--------------------------
[INFO] Building demo 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ demo ---
[INFO] Copying 1 resource from src\main\resources to target\classes
[INFO] 
[INFO] --- quarkus:3.23.3:generate-code (default) @ demo ---
[INFO] Generating with dryRun=false
[WARNING] OpenAPI 3.1 support is still in beta. To report an issue related to 3.1 spec, please kindly open an issue in the Github repo: https://github.com/openAPITools/openapi-generator.
[INFO] No .openapi-generator-ignore file found.
[INFO] OpenAPI Generator: quarkus (client)
[INFO] Generator 'quarkus' is considered stable.
[INFO] Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE="/usr/local/bin/clang-format -i"' (Linux/Mac)
[INFO] NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).
[INFO] Inline schema created as Pet_category. To have complete control of the model name, set the `title` field or use the modelNameMapping option (e.g. --model-name-mappings Pet_category=NewModel,ModelA=NewModelA in CLI) or inlineSchemaNameMapping option (--inline-schema-name-mappings Pet_category=NewModel,ModelA=NewModelA in CLI).
[... etc]

@jcjveraa
Copy link
Contributor Author

jcjveraa commented Jun 12, 2025

@ricardozanini I can't seem to add labels here? If approved, please backport to the 2.X.X-lts branch.

@ricardozanini ricardozanini changed the title Fix for GH issue #1047 Fix #1087 - Paths file when generating Java files on Windows Jun 13, 2025
@ricardozanini
Copy link
Member

Merging since I'm getting this on #1185 too and I want to give the credits to @jcjveraa

@ricardozanini ricardozanini merged commit 20559c6 into quarkiverse:main Jun 13, 2025
13 checks passed
github-actions bot pushed a commit that referenced this pull request Jun 13, 2025
hbelmiro pushed a commit that referenced this pull request Jun 15, 2025
Co-authored-by: jcjveraa <[email protected]>
Co-authored-by: veraj00 <[email protected]>
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.

Client for OAS 3.1 spec can not be generated on windows

3 participants