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

Can't run an example #12

Open
reznikmm opened this issue Feb 21, 2022 · 4 comments
Open

Can't run an example #12

reznikmm opened this issue Feb 21, 2022 · 4 comments
Labels

Comments

@reznikmm
Copy link

I've tried your docker image to play with OpenAPI.

  1. First issue: it doesn't provide Java:
root@3bb5bec6903c:/tmp/src#   openapi-generator generate --generator-name ada -i my-api.yaml -o client \
>        -DprojectName=MyProject --model-package MyProject.MyModule
/usr/bin/openapi-generator: 32: exec: java: not found
  1. After installing openjdk-17-jre-headless:
root@3bb5bec6903c:/tmp/src# openapi-generator generate --generator-name ada -i my-api.yaml -o client        -DprojectName=MyProject --model-package MyProject.MyModule
[error] Found unexpected parameters: [-DprojectName=MyProject]
  1. If I delete -DprojectName=MyProject:
root@3bb5bec6903c:/tmp/src# openapi-generator generate --generator-name ada -i my-api.yaml -o client  --model-package MyProject.MyModule
[main] ERROR i.s.parser.SwaggerCompatConverter - failed to read resource listing
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'paths': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (String)"paths:
  '/pet/{petId}':
...
@stcarrez stcarrez added the bug label Feb 21, 2022
@stcarrez
Copy link
Owner

Thanks! Oops... the command line described in the README was not updated and it's an old command.

Sorry about that. They changed the command line and I forgot to update it.

To have a look at an example, the following repository is more up to date, the Makefile has a correct command to run the generator

https://github.com/stcarrez/swagger-ada-todo

The command to generate should be:

openapi-generator generate --generator-name ada -i my-api.yaml --additional-properties projectName=MyProject --model-package MyProject.MyModule -o client

I'll try to fix that.

My Docker images are no longer up to date due to changes in Docker hub policies. I used to have them built by their system but this is no longer the case now.

@stcarrez
Copy link
Owner

I've fixed the Dockerfile and pushed a new image to Docker Hub. I've tested and we can run Java from the image now. Thanks!

@reznikmm
Copy link
Author

reznikmm commented Feb 22, 2022 via email

@stcarrez stcarrez reopened this Feb 26, 2022
@stcarrez
Copy link
Owner

Yes, it's an old example. Thanks for point out this to me!

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

No branches or pull requests

2 participants