Can't pass an array of strings to GitLab API (Build API)
Summary
Can't pass an array of strings to GitLab API: (Builds API: List project builds)
Steps to reproduce
These will be successful:
curl --request GET --header "PRIVATE-TOKEN: ${PRIVATE_TOKEN}" --data 'scope=failed' https://gitlab.com/api/v3/projects/13083/builds
curl --request GET --header "PRIVATE-TOKEN: ${PRIVATE_TOKEN}" --data 'scope=skipped' https://gitlab.com/api/v3/projects/13083/builds
and we'll get some lists.
But these will fail:
curl --request GET --header "PRIVATE-TOKEN: ${PRIVATE_TOKEN}" --data 'scope[]=failed' https://gitlab.com/api/v3/projects/13083/builds
curl --request GET --header "PRIVATE-TOKEN: ${PRIVATE_TOKEN}" --data 'scope[]=failed' --data 'scope[]=skipped' https://gitlab.com/api/v3/projects/13083/builds
and we'll get in both cases:
{"message":"Scope contains invalid value(s)"}
Expected behavior
All cases above should work successfully, in according to the documents doc/api/builds.md#list-project-builds
and doc/development/doc_styleguide.md#pass-arrays-to-api-calls
.
Actual behavior
As described above.
Appendix
In Build API, scope
can be created
, pending
, running
, success
, failed
, canceled
, and skipped
. They are defined in app/models/concerns/has_status.rb
. But created
and skipped
are not documented in doc/api/builds.md#list-project-builds
.