{"action":"opened","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-editor/issues/765","labels_url":"https://api.github.com/repos/swagger-api/swagger-editor/issues/765/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-editor/issues/765/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-editor/issues/765/events","html_url":"https://github.com/swagger-api/swagger-editor/issues/765","id":125706872,"number":765,"title":"allOf gives false warnings","user":{"login":"fehguy","id":249413,"avatar_url":"https://avatars.githubusercontent.com/u/249413?v=3","gravatar_id":"","url":"https://api.github.com/users/fehguy","html_url":"https://github.com/fehguy","followers_url":"https://api.github.com/users/fehguy/followers","following_url":"https://api.github.com/users/fehguy/following{/other_user}","gists_url":"https://api.github.com/users/fehguy/gists{/gist_id}","starred_url":"https://api.github.com/users/fehguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fehguy/subscriptions","organizations_url":"https://api.github.com/users/fehguy/orgs","repos_url":"https://api.github.com/users/fehguy/repos","events_url":"https://api.github.com/users/fehguy/events{/privacy}","received_events_url":"https://api.github.com/users/fehguy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-08T22:23:03Z","updated_at":"2016-01-08T22:23:03Z","closed_at":null,"body":"If you create a schema with definitions that include a `discriminator`, you will get a false warning that some models are not in use.  In fact, they _may_ be in use indirectly.\r\n\r\nFor example:\r\n\r\n```yaml\r\n  Animal:\r\n    type: object\r\n    discriminator: petType\r\n    properties:\r\n      commonName:\r\n        type: string\r\n  Cat:\r\n    allOf:\r\n      - $ref: '#/definitions/Animal'\r\n      - type: object\r\n        properties:\r\n          isFurry:\r\n            type: boolean\r\n            default: false\r\n```\r\n\r\nWill give a warning like such:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/249413/12210886/1b711680-b612-11e5-8642-b4a8fbd3ed9b.png)\r\n\r\nIt can be difficult to decide what _may_ be referenced by a discriminator, I believe we can encapsulate it in a fairly simple rule:\r\n\r\n* If a schema contains the `discriminator` field, AND that schema is referenced in an `allOf` construct, AND neither models are inline schemas, we should _ignore_ any warnings that the `allOf` model is unused."}}