07-23-2024 12:08
07-23-2024 12:08
Hi All,
I am trying to generate a Java Client Library based on this Swagger 2 definition. (https://dev.fitbit.com/build/reference/web-api/explore/fitbit-web-api-swagger.json)
However, somehow the library is not working in Java 17 and Spring Boot 3 since there are wrong dependencies used. Does may someone has an Idea how to generate a working Java Client Library.
This is the command I used to generate the Code:
swagger-v2 generate -i https://dev.fitbit.com/build/reference/web-api/explore/fitbit-web-api-swagger.json -l java -c ./swagger-config.json -o .
Would be really nice if someone could help here.
07-23-2024 12:16
07-23-2024 12:16
Sorry, forgot to add the swagger configuration File:
{
"modelPackage": "app.enduco.fitbit-swagger.model",
"apiPackage": "app.enduco.fitbit-swagger.api",
"invokerPackage": "app.enduco.fitbit-swagger.invoker",
"groupId": "app.enduco",
"artifactId": "fitbit-swagger",
"serializableModel": false,
"java11": true,
"hideGenerationTimestamp": true,
"library": "resttemplate",
"dateLibrary": "java11",
"artifactVersion": "1.16.3",
"localVariablePrefix": "local",
"jakarta": true,
"javaVersion": 17,
"useSpringBoot3": true,
"useJakartaEe": true
}
07-23-2024 13:12
07-23-2024 13:12
Hi @enduco
I can try to help, but people have had problems using our swagger file in the past. We've tried cleaning it up, but because the syntax of some endpoints are not always unique, it does cause problems.
Are the wrong dependencies related to the swagger json syntax? If so, would you provide the list of the wrong dependencies?
Thanks!
07-23-2024 23:25
07-23-2024 23:25
Hi Gordon,
Thanks for your reply, meanwhile I found this online swagger editor, which could be used and is compatible from 2.0 to 3.*, when I upload your file here it throws a lot of errors: