{"action":"opened","issue":{"url":"https://api.github.com/repos/oasis-tcs/sarif-spec/issues/176","repository_url":"https://api.github.com/repos/oasis-tcs/sarif-spec","labels_url":"https://api.github.com/repos/oasis-tcs/sarif-spec/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/oasis-tcs/sarif-spec/issues/176/comments","events_url":"https://api.github.com/repos/oasis-tcs/sarif-spec/issues/176/events","html_url":"https://github.com/oasis-tcs/sarif-spec/issues/176","id":324221086,"number":176,"title":"fileLocation uri property should be a URI reference","user":{"login":"lukecartey","id":5377966,"avatar_url":"https://avatars0.githubusercontent.com/u/5377966?v=4","gravatar_id":"","url":"https://api.github.com/users/lukecartey","html_url":"https://github.com/lukecartey","followers_url":"https://api.github.com/users/lukecartey/followers","following_url":"https://api.github.com/users/lukecartey/following{/other_user}","gists_url":"https://api.github.com/users/lukecartey/gists{/gist_id}","starred_url":"https://api.github.com/users/lukecartey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukecartey/subscriptions","organizations_url":"https://api.github.com/users/lukecartey/orgs","repos_url":"https://api.github.com/users/lukecartey/repos","events_url":"https://api.github.com/users/lukecartey/events{/privacy}","received_events_url":"https://api.github.com/users/lukecartey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-17T23:34:50Z","updated_at":"2018-05-17T23:34:50Z","closed_at":null,"author_association":"NONE","body":"The SARIF spec currently states:\r\n\r\n> A fileLocation object SHALL contain a property named uri whose value is a string containing a URI as described in [RFC3986].\r\n\r\nHowever RFC 3986 states:\r\n>   NOTE: Previous specifications used the terms \"partial URI\" and\r\n      \"relative URI\" to denote a relative reference to a URI.  As some\r\n      readers misunderstood those terms to mean that relative URIs are a\r\n      subset of URIs rather than a method of referencing URIs, this\r\n      specification simply refers to them as relative references.\r\n\r\ni.e. \"relative URI\"s are not themselves URIs. This is unfortunate, because it is common to store relative references in the `fileLocation.uri` property in conjunction with the `uriBaseId` property.\r\n\r\nThis confusion actually causes some issues for existing SARIF consumers. Currently, the SARIF schema specifies this:\r\n\r\n```\r\n        \"uri\": {\r\n          \"description\": \"A string containing a valid relative or absolute URI.\",\r\n          \"type\": \"string\",\r\n          \"format\": \"uri\"\r\n        },\r\n```\r\nHowever, `\"format\": \"uri\"` is a URI in the RFC 3986 sense, and does not permit scheme-less URIs such as relative references. This means a SARIF file with relative references in the URI will produce a warning when the file is validated strictly against the schema.\r\n\r\nI noticed this because I tried loading one of our SARIF files in the [Visual Studio Code SARIF extension](https://github.com/Microsoft/sarif-vscode-extension), and it reported warnings on my relative references saying \"String is not a URI: URI with a scheme is expected.\". This is because VS Code correctly validates JSON files against their schemas (see [here](https://github.com/Microsoft/vscode-json-languageservice/blob/master/src/parser/jsonParser.ts#L620) for where the VS Code JSON language service is processing the schema).\r\n\r\nConcretely, I suggest we:\r\n\r\n 1. Modify the wording of the spec to say:\r\n> A fileLocation object SHALL contain a property named uri whose value is a string containing a URI reference as described in [RFC3986].\r\n\r\n 2. Replace uses of the term \"relative URI\" with \"relative reference\" or \"relative URI reference\".\r\n\r\n 3. Modify the schema to use `uri-reference` (see http://json-schema.org/latest/json-schema-validation.html#rfc.section.7.3.5) instead of `uri` for the `fileLocation` uri property, i.e.:\r\n```\r\n        \"uri\": {\r\n          \"description\": \"A string containing a valid relative or absolute URI.\",\r\n          \"type\": \"string\",\r\n          \"format\": \"uri-reference\"\r\n        },\r\n```"}}
{"actor":{"display_login":"lukecartey"}}