{"action":"created","issue":{"url":"https://api.github.com/repos/openreferral/specification/issues/199","repository_url":"https://api.github.com/repos/openreferral/specification","labels_url":"https://api.github.com/repos/openreferral/specification/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/openreferral/specification/issues/199/comments","events_url":"https://api.github.com/repos/openreferral/specification/issues/199/events","html_url":"https://github.com/openreferral/specification/issues/199","id":334920202,"node_id":"MDU6SXNzdWUzMzQ5MjAyMDI=","number":199,"title":"Bug: fields are missing unique:true constraint in data-package.json","user":{"login":"timgdavies","id":342624,"node_id":"MDQ6VXNlcjM0MjYyNA==","avatar_url":"https://avatars0.githubusercontent.com/u/342624?v=4","gravatar_id":"","url":"https://api.github.com/users/timgdavies","html_url":"https://github.com/timgdavies","followers_url":"https://api.github.com/users/timgdavies/followers","following_url":"https://api.github.com/users/timgdavies/following{/other_user}","gists_url":"https://api.github.com/users/timgdavies/gists{/gist_id}","starred_url":"https://api.github.com/users/timgdavies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgdavies/subscriptions","organizations_url":"https://api.github.com/users/timgdavies/orgs","repos_url":"https://api.github.com/users/timgdavies/repos","events_url":"https://api.github.com/users/timgdavies/events{/privacy}","received_events_url":"https://api.github.com/users/timgdavies/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-22T15:24:24Z","updated_at":"2018-06-22T15:33:24Z","closed_at":null,"author_association":"COLLABORATOR","body":"Most `id` fields in [datapackage.json](https://github.com/openreferral/specification/blob/master/datapackage.json) are described with the text \"Each X must have a unique identifier\".\r\n\r\nHowever, in most cases, this is not properly declared in datapackage.json which contains\r\n\r\n```json\r\n\"constraints\": {\r\n   \"required\":true,\r\n}\r\n```\r\n\r\ninstead of\r\n\r\n```json\r\n\"constraints\": {\r\n     \"required\":true,\r\n     \"unique\":true\r\n}\r\n```\r\n\r\nThere is a question in this case of whether the schema or the description text should be treated as authoritative, but I would consider the intent of the field to be clear (ids MUST be unique) but that the constraint has not been properly enforced by the schema.\r\n\r\nThis feeds through into the documentation which is generated from the schema and presents:\r\n\r\n![image](https://user-images.githubusercontent.com/342624/41784811-ae935066-7638-11e8-9176-607866393dae.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/openreferral/specification/issues/comments/399482583","html_url":"https://github.com/openreferral/specification/issues/199#issuecomment-399482583","issue_url":"https://api.github.com/repos/openreferral/specification/issues/199","id":399482583,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTQ4MjU4Mw==","user":{"login":"timgdavies","id":342624,"node_id":"MDQ6VXNlcjM0MjYyNA==","avatar_url":"https://avatars0.githubusercontent.com/u/342624?v=4","gravatar_id":"","url":"https://api.github.com/users/timgdavies","html_url":"https://github.com/timgdavies","followers_url":"https://api.github.com/users/timgdavies/followers","following_url":"https://api.github.com/users/timgdavies/following{/other_user}","gists_url":"https://api.github.com/users/timgdavies/gists{/gist_id}","starred_url":"https://api.github.com/users/timgdavies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgdavies/subscriptions","organizations_url":"https://api.github.com/users/timgdavies/orgs","repos_url":"https://api.github.com/users/timgdavies/repos","events_url":"https://api.github.com/users/timgdavies/events{/privacy}","received_events_url":"https://api.github.com/users/timgdavies/received_events","type":"User","site_admin":false},"created_at":"2018-06-22T15:33:24Z","updated_at":"2018-06-22T15:33:24Z","author_association":"COLLABORATOR","body":"I've committed a fix to branch 199-unique-fields (see [diff against master here](https://github.com/openreferral/specification/compare/199-unique-fields?expand=1)).\r\n\r\nYou can also preview the docs as they appear for this branch at http://docs.openreferral.org/en/199-unique-fields/hsds/reference/#service_area\r\n\r\nAs this is a bug-fix that could affect users who are using datapackage.json to validate their data, I would suggest it should form a 1.1.1 bug fix release, and should have at least a two week comment period. \r\n\r\nThere may also be knock on effects to the API specification schema to be considered if @kinlane's work carried this bug forward into the API Spec. I've not checked on this yet. \r\n\r\n----\r\n\r\nThe *alternative* work-around for this issue, if the schema 'bug' (i.e. weaker validation than the normative descriptions state) is left in until a next version because it would affect current adopters, would be that we drop the 'Unique?' column from the documentation display, and rely on the prose to cover this. "}}
{"actor":{"display_login":"timgdavies"}}