3 FIXME lines indicate where a server-side PHP script (hosted within a TestRail installation) would be able to dynamically generate parts of the YAML file. Mainly, custom field and hostname definitions.
The different endpoints have been tagged as follows:
All endpoints have the TestRail tag (resulting in an object similar toSwaggerClient::TestRailAPI in the generated clients)
All get_ endpoints have the Readonly tag (resulting in an object similar toSwaggerClient::ReadonlyAPI in the generated clients)
All other operations have been given tags corresponding to role access permissions listed in TestRail /index.php?/admin/roles/edit/. This would allow someone with reduced permissions (e.g. only for adding test results) to create a SwaggerClient::ReadonlyAPI as well as a SwaggerClient::TestresultsAPI client
A RESTful API has been assumed; the same JSON object format is assumed to be used for get/add/update operations. The alternative would be a terrible amount of duplicating information between the parameters and Definitions sections.
Minimal testing has been done on the generated API, not exhaustive testing.
This swagger spec allows TestRail clients to be generated in any language. For a demo, paste the contents of testrail-swagger.yaml` into the online swagger editor at editor.swagger.io; you should see the generated API docs and links to download a client in many languages.
Notes on this document:
FIXME
lines indicate where a server-side PHP script (hosted within a TestRail installation) would be able to dynamically generate parts of the YAML file. Mainly, custom field and hostname definitions.TestRail
tag (resulting in an object similar toSwaggerClient::TestRailAPI
in the generated clients)get_
endpoints have theReadonly
tag (resulting in an object similar toSwaggerClient::ReadonlyAPI
in the generated clients)/index.php?/admin/roles/edit/
. This would allow someone with reduced permissions (e.g. only for adding test results) to create aSwaggerClient::ReadonlyAPI
as well as aSwaggerClient::TestresultsAPI
clientparameters
andDefinitions
sections.This file provides a first step toward #6.