07-23-2024 12:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-23-2024 12:08
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-23-2024 12:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



07-23-2024 13:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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!
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

07-23-2024 23:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-23-2024 23:25
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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:
Semantic error at paths./1/user/-/activities/active-zone-minutes/date/{start-date}/{end-date}/time/{start-time}/{end-time}.json.get.parameters.2.name
Path parameter "detail-level" must have the corresponding {detail-level} segment in the "/1/user/-/activities/active-zone-minutes/date/{start-date}/{end-date}/time/{start-time}/{end-time}.json" pathSemantic error at paths./1/user/-/activities/active-zone-minutes/date/{start-date}/{end-date}.json
Equivalent paths are not allowed.Semantic error at paths./1/user/-/activities/{resource-path}/date/{date}/{period}.json
Equivalent paths are not allowed.Semantic error at paths./1/user/-/activities/tracker/{resource-path}/date/{date}/{period}.json
Equivalent paths are not allowed.Semantic error at paths./1/user/-/body/log/fat/date/{base-date}/{end-date}.json
Equivalent paths are not allowed.Semantic error at paths./1/user/-/body/log/weight/date/{base-date}/{end-date}.json
Equivalent paths are not allowed.Semantic error at paths./1/user/-/body/{resource-path}/date/{base-date}/{end-date}.json
Equivalent paths are not allowed.Semantic error at paths./1/user/-/activities/heart/date/{base-date}/{end-date}.json
Equivalent paths are not allowed.Semantic error at paths./1/user/-/foods/log/{resource-path}/date/{date}/{period}.json
Equivalent paths are not allowed.Semantic error at paths./1/user/-/meals/{meal-id}.json
Declared path parameter "meal-id" needs to be defined within every operation in the path (missing in "post"), or moved to the path-level parameters object
