API v2 objects definitions

Hello :wave:

Do you know if there is a documentation describing the structure of the objects returned by API v2 calls?

For example, I am maintaining a small PHP client and had an issue about the Pipeline::vcs:: branch being null when the pipeline is “triggered”. In this case, the “branch” key is null and there is a “tag” key I didn’t find in the examples. Vcs->branch() needs to be nullable · Issue #51 · jmleroux/circleci-php-client · GitHub

It would be super cool to have a section in the reference guide describing the structure of the different objects: Pipeline, Workflow, Project, etc.

Thanks by advance,
JML

Just from a web search, it seems like this page has some docs, as well as downloadable Swagger document in JSON format

Looks like the example in the docs that you linked to in the PR that resolved your issue (CircleCI API) does have tag in one of the responses?

The swagger download at the top of the page does seem to have a definition of the vcs object under operationId": "getPipelineById", I think.

I’m guessing there will typically be branch or tag, but not both at the same time?

1 Like

Indeed, I don’t know how I could have miss the swagger!
Thank you very much for the answer.

1 Like