{"action":"created","issue":{"url":"https://api.github.com/repos/whitlockjc/json-refs/issues/5","labels_url":"https://api.github.com/repos/whitlockjc/json-refs/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/whitlockjc/json-refs/issues/5/comments","events_url":"https://api.github.com/repos/whitlockjc/json-refs/issues/5/events","html_url":"https://github.com/whitlockjc/json-refs/issues/5","id":52515511,"number":5,"title":"Add a configuration for depth of resolving circular $refs","user":{"login":"mohsen1","id":543633,"avatar_url":"https://avatars.githubusercontent.com/u/543633?v=3","gravatar_id":"","url":"https://api.github.com/users/mohsen1","html_url":"https://github.com/mohsen1","followers_url":"https://api.github.com/users/mohsen1/followers","following_url":"https://api.github.com/users/mohsen1/following{/other_user}","gists_url":"https://api.github.com/users/mohsen1/gists{/gist_id}","starred_url":"https://api.github.com/users/mohsen1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohsen1/subscriptions","organizations_url":"https://api.github.com/users/mohsen1/orgs","repos_url":"https://api.github.com/users/mohsen1/repos","events_url":"https://api.github.com/users/mohsen1/events{/privacy}","received_events_url":"https://api.github.com/users/mohsen1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-12-19T18:49:29Z","updated_at":"2015-02-08T00:25:16Z","closed_at":null,"body":"in `resolveRefs` API, add an option to resolve circular `$ref`s to more than 2 levels \r\n\r\nImagine I have this object:\r\n\r\n```json\r\n{\r\n  \"definitions\": {\r\n    \"Pet\": {\r\n      \"properties\": {\r\n        \"name\": {\r\n          \"$ref\": \"#/definitions/Name\"\r\n        }\r\n      }\r\n    },\r\n    \"Name\": {\r\n      \"properties\": {\r\n        \"firstName\": {\r\n          \"type\": \"string\"\r\n        },\r\n        \"lastName\": {\r\n          \"type\": \"string\"\r\n        },\r\n        \"pet\": {\r\n          \"$ref\": \"#/definitions/Pet\"\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nAfter resolving $refs I get this:\r\n\r\n```json\r\n{\r\n  \"definitions\": {\r\n    \"Pet\": {\r\n      \"properties\": {\r\n        \"name\": {\r\n          \"properties\": {\r\n            \"firstName\": {\r\n              \"type\": \"string\"\r\n            },\r\n            \"lastName\": {\r\n              \"type\": \"string\"\r\n            },\r\n            \"pet\": {\r\n              \"properties\": {\r\n                \"name\": {\r\n                  \"properties\": {\r\n                    \"firstName\": {\r\n                      \"type\": \"string\"\r\n                    },\r\n                    \"lastName\": {\r\n                      \"type\": \"string\"\r\n                    }\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          }\r\n        }\r\n      }\r\n    },\r\n    \"Name\": {\r\n      \"properties\": {\r\n        \"firstName\": {\r\n          \"type\": \"string\"\r\n        },\r\n        \"lastName\": {\r\n          \"type\": \"string\"\r\n        },\r\n        \"pet\": {\r\n          \"properties\": {\r\n            \"name\": {\r\n              \"properties\": {\r\n                \"firstName\": {\r\n                  \"type\": \"string\"\r\n                },\r\n                \"lastName\": {\r\n                  \"type\": \"string\"\r\n                },\r\n                \"pet\": {\r\n                  \"properties\": {}\r\n                }\r\n              }\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nCan you add an option to `resolveRefs` to go deeper than two levels?"},"comment":{"url":"https://api.github.com/repos/whitlockjc/json-refs/issues/comments/73390419","html_url":"https://github.com/whitlockjc/json-refs/issues/5#issuecomment-73390419","issue_url":"https://api.github.com/repos/whitlockjc/json-refs/issues/5","id":73390419,"user":{"login":"whitlockjc","id":98899,"avatar_url":"https://avatars.githubusercontent.com/u/98899?v=3","gravatar_id":"","url":"https://api.github.com/users/whitlockjc","html_url":"https://github.com/whitlockjc","followers_url":"https://api.github.com/users/whitlockjc/followers","following_url":"https://api.github.com/users/whitlockjc/following{/other_user}","gists_url":"https://api.github.com/users/whitlockjc/gists{/gist_id}","starred_url":"https://api.github.com/users/whitlockjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitlockjc/subscriptions","organizations_url":"https://api.github.com/users/whitlockjc/orgs","repos_url":"https://api.github.com/users/whitlockjc/repos","events_url":"https://api.github.com/users/whitlockjc/events{/privacy}","received_events_url":"https://api.github.com/users/whitlockjc/received_events","type":"User","site_admin":false},"created_at":"2015-02-08T00:25:16Z","updated_at":"2015-02-08T00:25:16Z","body":"Yup, I figured it out a comment ago.  ;)"}}