Skip to content

Commit

Permalink
copied code generated from swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
taraspos committed Oct 1, 2020
1 parent 75d89a5 commit f04439a
Show file tree
Hide file tree
Showing 14 changed files with 5,457 additions and 0 deletions.
36 changes: 36 additions & 0 deletions service/bitbucket/openapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Bitbucket OpenAPI

Bitbucket API swagger definitions can be found here [Bitbucket API](https://developer.atlassian.com/bitbucket/api/2/reference/meta/serialization#oai).

However, unfortunately it is not valid OpenAPI definition, see this issues:

1. [ktrysmt/go-bitbucket Issue #96](https://github.com/ktrysmt/go-bitbucket/issues/96)

1. [JIRA Bitbucket Cloud/BCLOUD-17601 - api.bitbucket.org/swagger.json is invalid](https://jira.atlassian.com/browse/BCLOUD-17601)

However I was able to generate some models via [OpenAPI Generator CLI](https://github.com/OpenAPITools/openapi-generator-cli/) with `--skip-validate-spec` ignoring the errors.
Here I copied only models related to [Code Insights](https://support.atlassian.com/bitbucket-cloud/docs/code-insights/).
Feel free to extend if needed.

## Attempts to generate code

- Go Swagger:

```sh
$ swagger validate https://bitbucket.org/api/swagger.json
json: cannot unmarshal bool into Go struct field SwaggerProps.definitions of type []string
```

- OpenAPI Generator CLI:

```sh
$ 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
...
```

0 comments on commit f04439a

Please sign in to comment.