{"action":"created","issue":{"url":"https://api.github.com/repos/whitlockjc/json-refs/issues/102","repository_url":"https://api.github.com/repos/whitlockjc/json-refs","labels_url":"https://api.github.com/repos/whitlockjc/json-refs/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/whitlockjc/json-refs/issues/102/comments","events_url":"https://api.github.com/repos/whitlockjc/json-refs/issues/102/events","html_url":"https://github.com/whitlockjc/json-refs/issues/102","id":197307245,"number":102,"title":"While resolving remote or relative references, json-refs does not do a complete resolve. ","user":{"login":"amarzavery","id":4521223,"avatar_url":"https://avatars.githubusercontent.com/u/4521223?v=3","gravatar_id":"","url":"https://api.github.com/users/amarzavery","html_url":"https://github.com/amarzavery","followers_url":"https://api.github.com/users/amarzavery/followers","following_url":"https://api.github.com/users/amarzavery/following{/other_user}","gists_url":"https://api.github.com/users/amarzavery/gists{/gist_id}","starred_url":"https://api.github.com/users/amarzavery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amarzavery/subscriptions","organizations_url":"https://api.github.com/users/amarzavery/orgs","repos_url":"https://api.github.com/users/amarzavery/repos","events_url":"https://api.github.com/users/amarzavery/events{/privacy}","received_events_url":"https://api.github.com/users/amarzavery/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-23T03:21:23Z","updated_at":"2016-12-23T04:50:27Z","closed_at":"2016-12-23T04:50:27Z","body":"For example: I have two swagger specs A and B residing at the same location.\r\nIn the following situation, it will correctly resolve a1 with the B1 from the definitions section of B.json. However, it will not resolve B2 (basically it will not traverse further to ensure that all the other locally referenced properties of that model are also fully resolved).\r\n\r\n- **A.json**\r\n```\r\n{\r\n. . .\r\n  \"definitions\": {\r\n     \"A1\": {\r\n        \"properties: {\r\n            \"a1\": { \"$ref\": \"./B.json#/definitions/B1\" }\r\n        }\r\n     }\r\n  }\r\n}\r\n```\r\n\r\n- **B.json**\r\n```\r\n{\r\n. . .\r\n  \"definitions\": {\r\n     \"B1\": {\r\n        \"properties: {\r\n            \"b1\": { \"$ref\": \"#/definitions/B2\" }\r\n        }\r\n     },\r\n     \"B2\": {\r\n        \"properties: {\r\n            \"b2\": { \"type\": \"string\" }\r\n        }\r\n     }\r\n  }\r\n}\r\n```\r\n\r\nPlease execute the following example to get an idea.\r\n```\r\njson-refs resolve  https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-network/2016-09-01/swagger/vmssNetworkInterface.json --filter relative --filter remote\r\n```\r\nThe output swagger will have \"$ref\": \"#/definitions/NetworkInterfacePropertiesFormat\" as a reference but there is no definitions section in the output swagger.\r\n\r\nCouple of questions:\r\nBtw, I need to do this because swagger-tools does not accept a swagger spec that contains a relative or remote file reference. Hence, I need to resolve them first and then validate the spec. \r\n\r\n1. Is it possible for swagger-tools to handle file references (relative or remote) then it will help us tremendously.\r\n\r\n2. Does sway handle remote or relative file references in a swagger spec?\r\n\r\nOnce again, thank you for all the quick responses and genuinely all the tools that you are developing in the swagger space are very very useful 👍 \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/whitlockjc/json-refs/issues/comments/268940417","html_url":"https://github.com/whitlockjc/json-refs/issues/102#issuecomment-268940417","issue_url":"https://api.github.com/repos/whitlockjc/json-refs/issues/102","id":268940417,"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":"2016-12-23T04:50:27Z","updated_at":"2016-12-23T04:50:27Z","body":"Also, I'm just telling you how/why things are now.  I'm all ears if there is a better way.  As for the API, I wanted it to be intuitive and to match Swagger objects.  I didn't want to create an object for every type because it just didn't make sense.  From a _model_ perspective, models are used as responses and inputs via parameter bodies.  That's why there are validations for those as they are.\r\n\r\nFeel free to make requests in Sway if you need something.  Other than that, I'm closing this because the issue you originally filed is a duplicate of #30."}}
{"actor":{"display_login":"whitlockjc"}}