{"action":"created","issue":{"url":"https://api.github.com/repos/BigstickCarpet/json-schema-ref-parser/issues/15","repository_url":"https://api.github.com/repos/BigstickCarpet/json-schema-ref-parser","labels_url":"https://api.github.com/repos/BigstickCarpet/json-schema-ref-parser/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/BigstickCarpet/json-schema-ref-parser/issues/15/comments","events_url":"https://api.github.com/repos/BigstickCarpet/json-schema-ref-parser/issues/15/events","html_url":"https://github.com/BigstickCarpet/json-schema-ref-parser/issues/15","id":144876725,"number":15,"title":"Invalid references created in `bundle` method","user":{"login":"hielsnoppe","id":1160569,"avatar_url":"https://avatars.githubusercontent.com/u/1160569?v=3","gravatar_id":"","url":"https://api.github.com/users/hielsnoppe","html_url":"https://github.com/hielsnoppe","followers_url":"https://api.github.com/users/hielsnoppe/followers","following_url":"https://api.github.com/users/hielsnoppe/following{/other_user}","gists_url":"https://api.github.com/users/hielsnoppe/gists{/gist_id}","starred_url":"https://api.github.com/users/hielsnoppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hielsnoppe/subscriptions","organizations_url":"https://api.github.com/users/hielsnoppe/orgs","repos_url":"https://api.github.com/users/hielsnoppe/repos","events_url":"https://api.github.com/users/hielsnoppe/events{/privacy}","received_events_url":"https://api.github.com/users/hielsnoppe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-31T12:05:34Z","updated_at":"2016-04-04T11:47:55Z","closed_at":"2016-04-03T09:13:51Z","body":"I am experiencing issues with the `bundle` method in a way that it creates broken references. See the following minimal example:\r\n\r\nfoo.json\r\n\r\n    {\r\n        \"$schema\": \"http://json-schema.org/draft-04/schema#\",\r\n        \"definitions\": {\r\n            \"foodef\": { \"$ref\": \"bar.json#/definitions/bardef\" }\r\n        },\r\n        \"type\": \"object\",\r\n        \"properties\": {\r\n            \"prop\": {\r\n                \"$ref\": \"#/definitions/foodef\"\r\n            }\r\n        }\r\n    }\r\n\r\nbar.json\r\n\r\n    {\r\n        \"$schema\": \"http://json-schema.org/draft-04/schema#\",\r\n        \"definitions\": {\r\n            \"bardef\": { \"type\": \"string\" }\r\n        }\r\n    }\r\n\r\nrun.js\r\n\r\n    var $RefParser = require('json-schema-ref-parser');\r\n\r\n    $RefParser\r\n        .bundle(\"foo.json\")\r\n        .then(function(schema) {\r\n            console.log(JSON.stringify(schema, null, '    '));\r\n        });\r\n\r\nRunning `node run.js > result.json` results in\r\n\r\nresult.json\r\n\r\n    {\r\n        \"$schema\": \"http://json-schema.org/draft-04/schema#\",\r\n        \"definitions\": {\r\n            \"foodef\": {\r\n                \"type\": \"string\"\r\n            }\r\n        },\r\n        \"type\": \"object\",\r\n        \"properties\": {\r\n            \"prop\": {\r\n                \"$ref\": \"#/definitions/foodef/definitions/bardef\"\r\n            }\r\n        }\r\n    }\r\n\r\nThere `#/definitions/foodef/definitions/bardef` is pointing nowhere.\r\n\r\nAm I doing something wrong or is this a bug?"},"comment":{"url":"https://api.github.com/repos/BigstickCarpet/json-schema-ref-parser/issues/comments/205261558","html_url":"https://github.com/BigstickCarpet/json-schema-ref-parser/issues/15#issuecomment-205261558","issue_url":"https://api.github.com/repos/BigstickCarpet/json-schema-ref-parser/issues/15","id":205261558,"user":{"login":"hielsnoppe","id":1160569,"avatar_url":"https://avatars.githubusercontent.com/u/1160569?v=3","gravatar_id":"","url":"https://api.github.com/users/hielsnoppe","html_url":"https://github.com/hielsnoppe","followers_url":"https://api.github.com/users/hielsnoppe/followers","following_url":"https://api.github.com/users/hielsnoppe/following{/other_user}","gists_url":"https://api.github.com/users/hielsnoppe/gists{/gist_id}","starred_url":"https://api.github.com/users/hielsnoppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hielsnoppe/subscriptions","organizations_url":"https://api.github.com/users/hielsnoppe/orgs","repos_url":"https://api.github.com/users/hielsnoppe/repos","events_url":"https://api.github.com/users/hielsnoppe/events{/privacy}","received_events_url":"https://api.github.com/users/hielsnoppe/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T11:47:55Z","updated_at":"2016-04-04T11:47:55Z","body":"Works for me. Thank you!"}}