Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
deepakkapoor23 opened this issue Jul 23, 2024 · 12 comments
Open

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

deepakkapoor23 opened this issue Jul 23, 2024 · 12 comments

Comments

@deepakkapoor23
Copy link

deepakkapoor23 commented Jul 23, 2024

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
Copy link
Member

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
Copy link
Author

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

@mswiderski
Copy link
Member

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

@deepakkapoor23
Copy link
Author

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
Copy link
Member

works without single issue
image

@deepakkapoor23
Copy link
Author

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
Copy link
Member

there you go

image

@deepakkapoor23
Copy link
Author

deepakkapoor23 commented Jul 26, 2024

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
Copy link
Member

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

@deepakkapoor23
Copy link
Author

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

@deepakkapoor23
Copy link
Author

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

@mswiderski
Copy link
Member

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants