Details
-
Bug
-
Resolution: Unresolved
-
Low
-
Severity 3 - Minor
-
Description
Issue Summary
Using Confluence's Open API (aka "swagger") spec to generate a client (e.g. in Java) as explained in the blog post Generating a Java REST Client for Confluence Cloud does not produce working code. There seem to be various errors and missing types in the spec.
Note: there are a couple of bugs in swagger-codegen 3.0.27 that interact badly with Confluence. Using a newer version overcomes these errors.
Steps to Reproduce
- Download a copy of Confluence open API spec: https://developer.atlassian.com/cloud/confluence/swagger.v3.json
- Use a tool like swagger-codegen to generate the Java client (e.g. "swagger-codegen -i swagger.v3.json -l java -o .")
Expected Results
The generated code works
Actual Results
The generated code doesn't work due to various errors and missing types in the spec including (but not limited to):
- ContentBody is missing the type ContentBodyExpandable
- Content is missing the type Map
- ContentBody.getValue() is missing
- GenericLinks type in the spec is missing all the fields (For example, the links for next when doing a paged query, etc)
etc.
There are also issues with `additionalProperties: true`, but these might be due to bugs in swagger-codegen: https://github.com/swagger-api/swagger-codegen/issues/5187
Workaround
Currently there is no known workaround for this behavior. A workaround will be added here when available