{"action":"closed","issue":{"url":"https://api.github.com/repos/whitlockjc/json-refs/issues/107","repository_url":"https://api.github.com/repos/whitlockjc/json-refs","labels_url":"https://api.github.com/repos/whitlockjc/json-refs/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/whitlockjc/json-refs/issues/107/comments","events_url":"https://api.github.com/repos/whitlockjc/json-refs/issues/107/events","html_url":"https://github.com/whitlockjc/json-refs/issues/107","id":216517907,"number":107,"title":"Generating response schema properties instead refs to a Definition","user":{"login":"Maykonn","id":1479805,"avatar_url":"https://avatars3.githubusercontent.com/u/1479805?v=3","gravatar_id":"","url":"https://api.github.com/users/Maykonn","html_url":"https://github.com/Maykonn","followers_url":"https://api.github.com/users/Maykonn/followers","following_url":"https://api.github.com/users/Maykonn/following{/other_user}","gists_url":"https://api.github.com/users/Maykonn/gists{/gist_id}","starred_url":"https://api.github.com/users/Maykonn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maykonn/subscriptions","organizations_url":"https://api.github.com/users/Maykonn/orgs","repos_url":"https://api.github.com/users/Maykonn/repos","events_url":"https://api.github.com/users/Maykonn/events{/privacy}","received_events_url":"https://api.github.com/users/Maykonn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-23T17:52:54Z","updated_at":"2017-03-23T18:19:47Z","closed_at":"2017-03-23T18:19:46Z","body":"My paths.yaml file content is:\r\n```\r\n/users:\r\n  get:\r\n    description: Users Collection.\r\n    responses:\r\n      '200':\r\n        description: An array of Users object\r\n        schema:\r\n          type: array\r\n          items:\r\n            $ref: \"#/definitions/User\"\r\n```\r\n\r\nMy definitions.yaml content is:\r\n```\r\nUser:\r\n  type: object\r\n  properties:\r\n    id:\r\n      type: integer\r\n    name:\r\n      type: string\r\n      maxLength: 180\r\n    email:\r\n      type: string\r\n      maxLength: 80\r\n```\r\n\r\nAnd finally my index.yaml is:\r\n```\r\n---\r\nswagger: '2.0'\r\n\r\nhost: api.something.com\r\nbasePath: /v1\r\nschemes:\r\n  - https\r\nproduces:\r\n  - application/json\r\nconsumes:\r\n  - application/json\r\n  - application/x-www-form-urlencoded\r\n  - application/multipart/form-data\r\n\r\ninfo:\r\n  $ref: \"./info.yaml\"\r\n\r\nparameters:\r\n  $ref: \"./parameters.yaml\"\r\n\r\npaths:\r\n  $ref: \"./paths.yaml\"\r\n\r\ndefinitions:\r\n  $ref: \"./definitions.yaml\"\r\n```\r\n\r\nSo, when I run the following command to generate a json file to solve $refs :\r\n```\r\njson-refs resolve index.yaml > index.json\r\n```\r\n\r\nThe generated json for `paths` property is:\r\n```\r\nSome json here...\r\n\r\n\"/users\": {\r\n    \"get\": {\r\n      \"description\": \"Users Collection\",\r\n      \"responses\": {\r\n        \"200\": {\r\n          \"description\": \"An array of Users object\",\r\n          \"schema\": {\r\n            \"type\": \"array\",\r\n            \"items\": {\r\n              \"type\": \"object\",\r\n              \"properties\": {\r\n                \"id\": {\r\n                  \"type\": \"integer\"\r\n                },\r\n                \"name\": {\r\n                  \"type\": \"string\",\r\n                  \"maxLength\": 180\r\n                },\r\n                \"email\": {\r\n                  \"type\": \"string\",\r\n                  \"maxLength\": 80\r\n                }\r\n              }\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  },\r\n\r\nMore json...\r\n```\r\n\r\nBut when I paste the generated json on swagger-editor, the editor warning that the definition `User`  is not used:\r\n`\r\nDefinition is not used: #/definitions/User\r\n`\r\n\r\nThe correct generated json for paths.yaml instead be like I paste above be something like the following?:\r\n```\r\n  \"/users\": {\r\n    \"get\": {\r\n      \"description\": \"Users Collection\",\r\n      \"responses\": {\r\n        \"200\": {\r\n          \"description\": \"An array of Users object\",\r\n          \"schema\": {\r\n            \"type\": \"array\",\r\n            \"items\": {\r\n              \"$ref\": \"#/definitions/User\"\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n```\r\n\r\nSee the [OpenAPI example for Paths Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#paths-object-example)."}}
{"actor":{"display_login":"whitlockjc"}}