automatiko-io / automatiko-engine

Automatiko workflow engine to build services and functions
https://automatiko.io
Apache License 2.0
73 stars 8 forks source link

Swagger/OpenAPI spec codegen error, missing rest package #446

Open deepakkapoor23 opened 1 month ago

deepakkapoor23 commented 1 month ago

Build failure due to missing rest package. I am running the DSL workflows example that uses petstore swagger api to generate rest classes for service invocation from the workflow. The same error is seen with other examples that use open API spec.

Build logs show the swagger file being processed with automatiko instructions on how to override url etc yet no files are written to disk.

I am running Automatiko 0.34.0 with Quarkus 3.11.0

io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step io.automatiko.engine.quarkus.deployment.AutomatikoQuarkusProcessor#generateClassesFromResourcesStep threw an exception: java.lang.IllegalStateException: src/main/java/io/automatiko/engine/app/handlers/SwaggerPetstore_getPetById_restService_1_3_Handler.java:8: error: package io.automatiko.engine.app.rest does not exist io.automatiko.engine.app.rest.SwaggerPetstore service; ^,Note: src/main/java/io/automatiko/app/ApplicationProcesses.java uses unchecked or unsafe operations.,Note: Recompile with -Xlint:unchecked for details. at io.automatiko.engine.quarkus.deployment.AutomatikoQuarkusProcessor.compile(AutomatikoQuarkusProcessor.java:609) at io.automatiko.engine.quarkus.deployment.AutomatikoQuarkusProcessor.generateClassesFromResourcesStep(AutomatikoQuarkusProcessor.java:198)

mswiderski commented 1 month ago

just tried this example java dsl workflow https://github.com/automatiko-io/automatiko-examples/blob/main/workflows-java-dsl/src/main/java/io/automatiko/examples/dsl/MyWorkflows.java#L88 and all works without issue. Could it be again gradle related?

deepakkapoor23 commented 1 month ago

I am seeing this with both Maven and Gradle builds...

mswiderski commented 1 month ago

can you describe which example do you run or share your project?

deepakkapoor23 commented 1 month ago

If I simply run this one DSL workflow where it needs to generate petstore rest service from swagger spec, I see this error

https://github.com/automatiko-io/automatiko-examples/blob/main/workflows-java-dsl/src/main/java/io/automatiko/examples/dsl/MyWorkflows.java#L99

Please see the attached sample project and try to build it with Maven command: mvnw clean package "-DskipTests"

automatiko-examples.zip

mswiderski commented 1 month ago

works without single issue image

deepakkapoor23 commented 1 month ago

Any idea what could be wrong in my environment? Can you please share your target folder, I'm curious what did it generate in the rest package.

mswiderski commented 1 month ago

there you go

image

deepakkapoor23 commented 1 month ago

Strange, that whole package is missing for me. Did you simply run the sample project I shared or had to change some properties? Are you running on Mac or Windows? I'm running it on Windows

mswiderski commented 1 month ago

no changes, unzip and run. And what happens when you run mvn clean quarkus:dev

deepakkapoor23 commented 1 month ago

Same result in quarkus:dev mode, missing rest package.

deepakkapoor23 commented 1 month ago

Guess what, I built it on Linux and it builds fine. So its indeed a Windows path issue.

mswiderski commented 1 month ago

hmm weird as it used to work on windows too. Will try to look into though might not be easy - don't have windows machine any more...