From 1105f03181d127dbf28372f1743bd0bdf00f4ae6 Mon Sep 17 00:00:00 2001 From: hubwriter Date: Tue, 29 Jun 2021 13:55:51 +0100 Subject: [PATCH] Enable/disable advanced security via the REST API's `repository` endpoint (GA) (#19859) * Add has_advanced_security parameter * Add temp (locally generated) JSON files * Add temp (locally generated) JSON files * Fix 'details' wording mentioned by Marco * Add temp (locally generated) JSON files * Add temp (locally generated) JSON files * Remove locally generated JSON files * Add locally generated JSON files * Remove development mode JSON files * Update OpenAPI Descriptions (#20149) * Update OpenAPI Descriptions * Add decorated OpenAPI schema files Co-authored-by: github-openapi-bot * Update OpenAPI Descriptions (#20151) * Update OpenAPI Descriptions * Add decorated OpenAPI schema files Co-authored-by: github-openapi-bot * Update OpenAPI Descriptions (#20150) * Update OpenAPI Descriptions * Add decorated OpenAPI schema files Co-authored-by: github-openapi-bot Co-authored-by: github-openapi-bot <69533958+github-openapi-bot@users.noreply.github.com> Co-authored-by: github-openapi-bot --- content/rest/reference/code-scanning.md | 85 +------------------------ 1 file changed, 3 insertions(+), 82 deletions(-) diff --git a/content/rest/reference/code-scanning.md b/content/rest/reference/code-scanning.md index 5cfa39ccd8..ab5152b76d 100644 --- a/content/rest/reference/code-scanning.md +++ b/content/rest/reference/code-scanning.md @@ -22,92 +22,13 @@ The {% data variables.product.prodname_code_scanning %} API lets you retrieve an {% ifversion fpt or ghes > 3.0 or ghae %} ### Custom media type for {% data variables.product.prodname_code_scanning %} -There is one supported custom media type for the {% data variables.product.prodname_code_scanning %} REST API. You can use this with `GET` requests sent to the `/analyses/{analysis_id}` endpoint. When you use this media type with this operation, the response includes a subset of the actual data that was uploaded for the specified analysis, rather than details about the analysis, which is returned when you use the default media type. The response also includes additional data such as the `github/alertNumber` and `github/alertUrl` properties. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). +There is one supported custom media type for the {% data variables.product.prodname_code_scanning %} REST API. application/sarif+json +You can use this with `GET` requests sent to the `/analyses/{analysis_id}` endpoint. For more information about this operation, see "[Get a {% data variables.product.prodname_code_scanning %} analysis for a repository](#get-a-code-scanning-analysis-for-a-repository)." When you use this media type with this operation, the response includes a subset of the actual data that was uploaded for the specified analysis, rather than the summary of the analysis that's returned when you use the default media type. The response also includes additional data such as the `github/alertNumber` and `github/alertUrl` properties. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). + For more information, see "[Media types](/rest/overview/media-types)." - -#### Response using the custom media type - -This example response is from a `GET` request to the `/analyses/{analysis_id}` endpoint, using `application/sarif+json` as the `Accept` header value. The example has had indentation and line breaks added for readability. For more information about this endpoint, see "[Get a {% data variables.product.prodname_code_scanning %} analysis for a repository](#get-a-code-scanning-analysis-for-a-repository)." - -``` -{ - "runs": [ - { - "artifacts": [ - { - "location": { - "index": 0, - "uri": "src/promiseUtils.js" - } - }, - { - "location": { - "index": 1, - "uri": "main.js" - } - } - ], - "conversion": { - "tool": { - "driver": { - "name": "GitHub Code Scanning" - } - } - }, - "results": [ - { - "correlationGuid": "7f75ba0b-61a9-11eb-b882-b4969152bf2c", - "level": "warning", - "locations": [ - { - "physicalLocation": { - "artifactLocation": { - "index": 0, - "uri": "src/promiseUtils.js" - }, - "region": { - "endLine": 2, - "startColumn": 1, - "startLine": 2 - } - } - } - ], - "message": { - "text": "Function resolvingPromise is sometimes invoked as a constructor (for example [here](1)), and sometimes as a normal function (for example [here](2))." - }, - "partialFingerprints": { - "primaryLocationLineHash": "5061c3315a741b7d:1" - }, - "properties": { - "github/alertNumber": 4, - "github/alertUrl": "https://api.github.com/repos/octocat/hello-world/code-scanning/alerts/4" - } - }, - ... - ], - "tool": { - "driver": { - "name": "CodeQL", - "version": "2.0.0" - } - }, - "versionControlProvenance": [ - { - "branch": "refs/heads/master", - "repositoryUri": "https://github.com/octocat/hello-world", - "revisionId": "c18c69115354ff0166991962832dc2bd7756e655" - } - ] - } - ], - "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", - "version": "2.1.0" -} -``` {% endif %} {% include rest_operations_at_current_path %}