{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2219","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2219/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2219/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2219/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/2219","id":135710252,"number":2219,"title":"Swagger ignores vendorextention for $ref type properties","user":{"login":"sbelan","id":17060114,"avatar_url":"https://avatars.githubusercontent.com/u/17060114?v=3","gravatar_id":"","url":"https://api.github.com/users/sbelan","html_url":"https://github.com/sbelan","followers_url":"https://api.github.com/users/sbelan/followers","following_url":"https://api.github.com/users/sbelan/following{/other_user}","gists_url":"https://api.github.com/users/sbelan/gists{/gist_id}","starred_url":"https://api.github.com/users/sbelan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbelan/subscriptions","organizations_url":"https://api.github.com/users/sbelan/orgs","repos_url":"https://api.github.com/users/sbelan/repos","events_url":"https://api.github.com/users/sbelan/events{/privacy}","received_events_url":"https://api.github.com/users/sbelan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Need%20community%20contribution","name":"Need community contribution","color":"e3ff00"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/11","html_url":"https://github.com/swagger-api/swagger-codegen/milestones/v2.3.0","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/11/labels","id":1794308,"number":11,"title":"v2.3.0","description":"","creator":{"login":"wing328","id":934260,"avatar_url":"https://avatars.githubusercontent.com/u/934260?v=3","gravatar_id":"","url":"https://api.github.com/users/wing328","html_url":"https://github.com/wing328","followers_url":"https://api.github.com/users/wing328/followers","following_url":"https://api.github.com/users/wing328/following{/other_user}","gists_url":"https://api.github.com/users/wing328/gists{/gist_id}","starred_url":"https://api.github.com/users/wing328/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wing328/subscriptions","organizations_url":"https://api.github.com/users/wing328/orgs","repos_url":"https://api.github.com/users/wing328/repos","events_url":"https://api.github.com/users/wing328/events{/privacy}","received_events_url":"https://api.github.com/users/wing328/received_events","type":"User","site_admin":false},"open_issues":127,"closed_issues":0,"state":"open","created_at":"2016-05-29T08:58:06Z","updated_at":"2016-07-07T13:53:55Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2016-02-23T11:25:40Z","updated_at":"2016-07-07T14:22:22Z","closed_at":null,"body":"Hi @wing328 ,\r\n\r\nSwagger ignores vendorextention for $ref type properties. For e.g.\r\nIf there is a property as follows in yaml\r\n\r\n  ```\r\n  myObject:\r\n       properties:\r\n               myid:\r\n                  type: int\r\n                  x-app-extensions: {\"aaid\" : \"bb\", \"ccid\" : \"dd\"}\r\nerrors:\r\n                   x-app-extensions: {\"aaerr\" : \"bb\", \"ccerr\" : \"dd\"}\r\n    $ref: \"#/definitions/errorModel\"\r\n\r\n```\r\nThen, swagger model ignores vendorextensions for errors, and only has only $ref property in the parsed json node, and same in reflected in created java model. \r\nBut, vendorextenion is correctly picked up for myid.\r\nThe ignorance of vendor extension is due to an issue in following snippet of the code of io.swagger.util.PropertyDeserializer.propertyFromNode(JsonNode) method.\r\n\r\n  ```\r\n   JsonNode detailNode = node.get(\"$ref\");\r\n  if (detailNode != null) {\r\n      return new RefProperty(detailNode.asText()).description(description);\r\n  }\r\n\r\n```\r\n  Is it expected that, $ref type nodes are not supposed to have any other properties? \r\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/231092528","html_url":"https://github.com/swagger-api/swagger-codegen/issues/2219#issuecomment-231092528","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2219","id":231092528,"user":{"login":"Nepoxx","id":1477090,"avatar_url":"https://avatars.githubusercontent.com/u/1477090?v=3","gravatar_id":"","url":"https://api.github.com/users/Nepoxx","html_url":"https://github.com/Nepoxx","followers_url":"https://api.github.com/users/Nepoxx/followers","following_url":"https://api.github.com/users/Nepoxx/following{/other_user}","gists_url":"https://api.github.com/users/Nepoxx/gists{/gist_id}","starred_url":"https://api.github.com/users/Nepoxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nepoxx/subscriptions","organizations_url":"https://api.github.com/users/Nepoxx/orgs","repos_url":"https://api.github.com/users/Nepoxx/repos","events_url":"https://api.github.com/users/Nepoxx/events{/privacy}","received_events_url":"https://api.github.com/users/Nepoxx/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T14:22:22Z","updated_at":"2016-07-07T14:22:22Z","body":"Issue is still present in 2.2.0\r\n\r\n```yaml\r\n# ...\r\nresponses:\r\n      200:\r\n        description: A user's game state\r\n        schema:\r\n          type: object\r\n          properties:\r\n            gs:\r\n              $ref: '#/definitions/gs'\r\n\r\ngs:\r\n  x-name: gameState # does not work\r\n  type: object\r\n  properties:\r\n    v:\r\n      x-name: version # works\r\n      type: integer\r\n    ud:\r\n      x-name: userData # does not work\r\n      title: userData\r\n      type: object\r\n      properties:\r\n        n:\r\n          x-name: name # this one works fine\r\n          type: string\r\n```\r\n\r\nThis is the debug output from generating:\r\n\r\n```json\r\n{\r\n  \"importPath\" : \"IO.Swagger.Model.LoadGameState\",\r\n  \"model\" : {\r\n    \"name\" : \"LoadGameState\",\r\n    \"classname\" : \"LoadGameState\",\r\n    \"classVarName\" : \"LoadGameState\",\r\n    \"modelJson\" : \"{\\n  \\\"type\\\" : \\\"object\\\",\\n  \\\"required\\\" : [ \\\"v\\\" ],\\n  \\\"properties\\\" : {\\n    \\\"v\\\" : {\\n      \\\"type\\\" : \\\"integer\\\",\\n      \\\"x-name\\\" : \\\"version\\\"\\n    },\\n    \\\"ud\\\" : {\\n      \\\"$ref\\\" : \\\"#/definitions/LoadGameState_ud\\\"\\n    }\\n  },\\n  \\\"x-name\\\" : \\\"gameState\\\"\\n}\",\r\n    \"classFilename\" : \"LoadGameState\",\r\n    \"vars\" : [ {\r\n      \"baseName\" : \"v\",\r\n      \"getter\" : \"getV\",\r\n      \"setter\" : \"setV\",\r\n      \"datatype\" : \"long?\",\r\n      \"datatypeWithEnum\" : \"long?\",\r\n      \"name\" : \"V\",\r\n      \"defaultValue\" : \"null\",\r\n      \"defaultValueWithParam\" : \" = data.v;\",\r\n      \"baseType\" : \"long?\",\r\n      \"example\" : \"null\",\r\n      \"jsonSchema\" : \"{\\n  \\\"type\\\" : \\\"integer\\\",\\n  \\\"x-name\\\" : \\\"version\\\"\\n}\",\r\n      \"hasMore\" : true,\r\n      \"required\" : true,\r\n      \"hasMoreNonReadOnly\" : true,\r\n      \"isPrimitiveType\" : true,\r\n      \"isNotContainer\" : true,\r\n      \"isInteger\" : true,\r\n      \"isEnum\" : false,\r\n      \"vendorExtensions\" : {\r\n        \"x-name\" : \"version\" // <-------------------------------------------------------- Good\r\n      },\r\n      \"nameInCamelCase\" : \"V\"\r\n    }, {\r\n      \"baseName\" : \"ud\",\r\n      \"complexType\" : \"LoadGameStateUd\",\r\n      \"getter\" : \"getUd\",\r\n      \"setter\" : \"setUd\",\r\n      \"datatype\" : \"LoadGameStateUd\",\r\n      \"datatypeWithEnum\" : \"LoadGameStateUd\",\r\n      \"name\" : \"Ud\",\r\n      \"defaultValue\" : \"null\",\r\n      \"defaultValueWithParam\" : \" = data.ud;\",\r\n      \"baseType\" : \"LoadGameStateUd\",\r\n      \"example\" : \"null\",\r\n      \"jsonSchema\" : \"{\\n  \\\"$ref\\\" : \\\"#/definitions/LoadGameState_ud\\\"\\n}\",\r\n      \"isNotContainer\" : true,\r\n      \"isEnum\" : false,\r\n      \"vendorExtensions\" : { }, <------------------------------------------------ :(\r\n      \"nameInCamelCase\" : \"Ud\"\r\n    } ]\r\n   \"//\": \"omitted the rest\"\r\n  }\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"Nepoxx"}}