provide an official go client library for v2 API
S
Stephen Daspit
Right now, users can use OpenAPI tooling to generate a Go client for the v2 API based on the spec.
This client gets 90% of the way there, but there are still problems:
* the spec uses
anyOf
in a manner that produces invalid codeIt would be quite convenient to have an official client library.
K
Kelvin Tay
Hi stephen,
I believe you may have been referring to using tools like goswagger to generate a Go client based on OpenAPI specifications.
https://goswagger.io/
If so, indeed, our V2 API spec uses features like
anyOf
that is part of OpenAPI 3.0 specification.https://circleci.com/docs/api/v2/index.html
https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/
I understand in goswagger's case, it requires OpenAPI 2.0 specification (aka Swagger 2.0) instead.
As such, you/we would want to convert the V2 API spec to a Swagger 2.0 definition instead.
On this note, I had been working on a related project here, using goswagger:
https://github.com/kelvintaywl/circleci-go-sdk
I had to map the V2 API to its Swagger 2.0 definition here:
https://github.com/kelvintaywl/circleci-go-sdk/blob/main/openapi.yaml
Note that this is not official; it is my side project.
You are welcome to reference / fork / use it if it is helpful!
Hope this helps!