This is trimmed version of generated bitbucket OpenAPI client, which contains Reports API only which is needed to use the Code Insights feature for reviewdog/reviewdog.
Bitbucket API swagger definitions can be found here Bitbucket API.
Unfortunately officially provided OpenAPI definition is not completely valid , see this issues:
However, we were able to generate needed models via OpenAPI Generator CLI with --skip-validate-spec
ignoring the errors.
Also, to make it work, in generated code URLs {workspace}
need to be replaced with {username}
,
because BitBucket OpenAPI definition is not correct ๐คท:
Resource URL is /2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}
but Path actual parameters are username
, repo_slug
, commit
, reportId
-
Go Swagger:
$ swagger validate https://bitbucket.org/api/swagger.json json: cannot unmarshal bool into Go struct field SwaggerProps.definitions of type []string
-
OpenAPI Generator CLI:
$ docker run --rm -v "${PWD}:/local" \ openapitools/openapi-generator-cli generate \ -i https://api.bitbucket.org/swagger.json -g go \ -o /local/out/go ... Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI). | Error count: 53, Warning count: 17 ...