{"action":"created","issue":{"url":"https://api.github.com/repos/kogosoftwarellc/express-openapi/issues/17","repository_url":"https://api.github.com/repos/kogosoftwarellc/express-openapi","labels_url":"https://api.github.com/repos/kogosoftwarellc/express-openapi/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/kogosoftwarellc/express-openapi/issues/17/comments","events_url":"https://api.github.com/repos/kogosoftwarellc/express-openapi/issues/17/events","html_url":"https://github.com/kogosoftwarellc/express-openapi/issues/17","id":140573857,"number":17,"title":"Support external schema reference","user":{"login":"MugeSo","id":250446,"avatar_url":"https://avatars.githubusercontent.com/u/250446?v=3","gravatar_id":"","url":"https://api.github.com/users/MugeSo","html_url":"https://github.com/MugeSo","followers_url":"https://api.github.com/users/MugeSo/followers","following_url":"https://api.github.com/users/MugeSo/following{/other_user}","gists_url":"https://api.github.com/users/MugeSo/gists{/gist_id}","starred_url":"https://api.github.com/users/MugeSo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MugeSo/subscriptions","organizations_url":"https://api.github.com/users/MugeSo/orgs","repos_url":"https://api.github.com/users/MugeSo/repos","events_url":"https://api.github.com/users/MugeSo/events{/privacy}","received_events_url":"https://api.github.com/users/MugeSo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2016-03-14T04:46:48Z","updated_at":"2016-03-16T19:58:15Z","closed_at":null,"body":"## Problem\r\nNow my api receives json schema object.\r\n\r\nso, i wrote:\r\n```javascript\r\n// in handler\r\npost.apiDoc = {\r\n    description: \"create new schema definition\",\r\n    operationId: \"createSchema\",\r\n    parameters: [\r\n        {\r\n            in: 'body',\r\n            name: 'schema',\r\n            schema: {$ref: '#/definitions/schema' }\r\n        }\r\n    ],\r\n    responses: {\r\n        \"201\": { $ref: '#/responses/created' },\r\n        \"default\": { $ref: \"#/responses/error\" }\r\n    }\r\n}\r\n\r\n// in apidoc.js#definitions\r\n{ \r\n    \"schema\": { \"$ref\": \"http://json-schema.org/schema\" }\r\n}  \r\n```\r\n\r\nThen i sent request to it and got:\r\n```json\r\n{\r\n    \"status\":400,\r\n    \"errors\":[\r\n        {\r\n            \"message\":\"no such schema <http://json-schema.org/schema>\",\r\n            \"schema\":{\"$ref\":\"http://json-schema.org/schema\"},\r\n            \"location\":\"body\"\r\n        }\r\n    ]\r\n}\r\n```\r\n\r\n## Suggestion\r\n\r\n1.  support external schema\r\n2.  support maping external id to local file (for when can not connect to server hosting the external schema or the url don't serve schema json.)\r\n3.  keep external reference as is in exposed api doc, not expanded loaded schema.\r\n"},"comment":{"url":"https://api.github.com/repos/kogosoftwarellc/express-openapi/issues/comments/197519200","html_url":"https://github.com/kogosoftwarellc/express-openapi/issues/17#issuecomment-197519200","issue_url":"https://api.github.com/repos/kogosoftwarellc/express-openapi/issues/17","id":197519200,"user":{"login":"jsdevel","id":2605980,"avatar_url":"https://avatars.githubusercontent.com/u/2605980?v=3","gravatar_id":"","url":"https://api.github.com/users/jsdevel","html_url":"https://github.com/jsdevel","followers_url":"https://api.github.com/users/jsdevel/followers","following_url":"https://api.github.com/users/jsdevel/following{/other_user}","gists_url":"https://api.github.com/users/jsdevel/gists{/gist_id}","starred_url":"https://api.github.com/users/jsdevel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsdevel/subscriptions","organizations_url":"https://api.github.com/users/jsdevel/orgs","repos_url":"https://api.github.com/users/jsdevel/repos","events_url":"https://api.github.com/users/jsdevel/events{/privacy}","received_events_url":"https://api.github.com/users/jsdevel/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T19:58:15Z","updated_at":"2016-03-16T19:58:15Z","body":"[json-ref-lite](https://github.com/coderofsalvation/json-ref-lite) looks pretty cool too."}}