diff --git a/api/controllers/site.js b/api/controllers/site.js index f37df902a..173283f52 100644 --- a/api/controllers/site.js +++ b/api/controllers/site.js @@ -196,6 +196,7 @@ module.exports = wrapHandlers({ branch: sbt.branch, name: sbt.BuildTaskType.name, description: sbt.BuildTaskType.description, + url: sbt.BuildTaskType.url, })); return res.json(siteBuildTasks); diff --git a/public/swagger/SiteBuildTask.json b/public/swagger/SiteBuildTask.json new file mode 100644 index 000000000..78b4b675c --- /dev/null +++ b/public/swagger/SiteBuildTask.json @@ -0,0 +1,37 @@ +{ + "type": "object", + "required": ["id", "name", "description", "startsWhen", "url"], + "properties": { + "id": { + "type": "string", + "enum": ["a11y", "owasp-zap"] + }, + "sbtId": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "metadata": { + "type": "object", + "properties": { + "rules": { + "type": "array" + }, + "runDay": { + "type": "integer" + } + } + }, + "url": { + "type": "string" + }, + "branch": { + "type": "string" + } + } +} + diff --git a/public/swagger/index.yml b/public/swagger/index.yml index 6bdca2c56..ca11a40fa 100644 --- a/public/swagger/index.yml +++ b/public/swagger/index.yml @@ -1246,6 +1246,26 @@ paths: description: The site of the user environment variable is to be added to cannot be found schema: $ref: 'Error.json' + /site/{site_id}/task: + parameters: + - name: site_id + in: path + description: The id of the site + type: integer + required: true + get: + summary: Fetch the list of registered build task types for the given site + responses: + 200: + description: A list of registered build task types for the given site + schema: + type: array + items: + $ref: 'SiteBuildTask.json' + 404: + description: Not found + schema: + $ref: 'Error.json' /site/{site_id}/tasks: parameters: - name: site_id