{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-js/issues/402","labels_url":"https://api.github.com/repos/swagger-api/swagger-js/issues/402/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-js/issues/402/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-js/issues/402/events","html_url":"https://github.com/swagger-api/swagger-js/issues/402","id":72379747,"number":402,"title":"A $ref needs to be wrapped inside a schema which is not according to spec.","user":{"login":"ralphvanetten","id":1533323,"avatar_url":"https://avatars.githubusercontent.com/u/1533323?v=3","gravatar_id":"","url":"https://api.github.com/users/ralphvanetten","html_url":"https://github.com/ralphvanetten","followers_url":"https://api.github.com/users/ralphvanetten/followers","following_url":"https://api.github.com/users/ralphvanetten/following{/other_user}","gists_url":"https://api.github.com/users/ralphvanetten/gists{/gist_id}","starred_url":"https://api.github.com/users/ralphvanetten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralphvanetten/subscriptions","organizations_url":"https://api.github.com/users/ralphvanetten/orgs","repos_url":"https://api.github.com/users/ralphvanetten/repos","events_url":"https://api.github.com/users/ralphvanetten/events{/privacy}","received_events_url":"https://api.github.com/users/ralphvanetten/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-01T07:57:39Z","updated_at":"2015-05-03T09:36:03Z","closed_at":null,"body":"This is a followup to https://github.com/swagger-api/swagger-ui/issues/1228\r\n\r\nI have\r\n\r\n```\r\n \"Person\" : {\r\n         \"type\" : \"object\",\r\n         \"title\" : \"Information about a person\",\r\n         \"properties\" : {\r\n            \"externalId1\" : {\r\n               \"title\" : \"first\",\r\n               \"type\" : \"object\",\r\n               \"$ref\" : \"#/definitions/map1\"\r\n            }\r\n```\r\n\r\nwhich does not work. The answer was to wrap it inside a \"schema\" and then it works:\r\n\r\n```\r\n\"externalId1\" : {\r\n               \"title\" : \"first\",\r\n               \"type\" : \"object\",\r\n               \"schema\": {  // < -------------- This will make it work like you expect\r\n                    \"$ref\" : \"#/definitions/map1\"\r\n                } // ------------------- :)\r\n            },\r\n```\r\n\r\nHowever, after looking into the spec of both swagger and JSON schema, there is no reference anywhere the \"schema\" wrapper is required. \r\n\r\nAs far as I can tell, my version without the \"schema\" wrapper is correct.\r\n\r\nThe example here https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#simple-model does not use the \"schema\" wrapper.\r\n\r\nAm I missing something?"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-js/issues/comments/98460592","html_url":"https://github.com/swagger-api/swagger-js/issues/402#issuecomment-98460592","issue_url":"https://api.github.com/repos/swagger-api/swagger-js/issues/402","id":98460592,"user":{"login":"webron","id":241629,"avatar_url":"https://avatars.githubusercontent.com/u/241629?v=3","gravatar_id":"","url":"https://api.github.com/users/webron","html_url":"https://github.com/webron","followers_url":"https://api.github.com/users/webron/followers","following_url":"https://api.github.com/users/webron/following{/other_user}","gists_url":"https://api.github.com/users/webron/gists{/gist_id}","starred_url":"https://api.github.com/users/webron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webron/subscriptions","organizations_url":"https://api.github.com/users/webron/orgs","repos_url":"https://api.github.com/users/webron/repos","events_url":"https://api.github.com/users/webron/events{/privacy}","received_events_url":"https://api.github.com/users/webron/received_events","type":"User","site_admin":false},"created_at":"2015-05-03T09:36:03Z","updated_at":"2015-05-03T09:36:03Z","body":"@ralphvanetten - that's not the way to define it, but without seeing what `#/definitions/map1`, it would be difficult to suggest the proper solution."}}