stcarrez / swagger-ada

Ada support for OpenAPI code generator
Apache License 2.0
27 stars 3 forks source link

Can't run an example #12

Open reznikmm opened 2 years ago

reznikmm commented 2 years ago

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
  2. 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]
  3. 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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Please check also provided toml example, because i cant process it

вт, 22 февр. 2022 г., 01:12 Stephane Carrez @.***>:

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!

— Reply to this email directly, view it on GitHub https://github.com/stcarrez/swagger-ada/issues/12#issuecomment-1047288642, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRB773ZJNDE3FKSB4I25VDU4LBFHANCNFSM5O7DRGKA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

stcarrez commented 2 years ago

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