{"action":"opened","issue":{"url":"https://api.github.com/repos/domaindrivendev/Swashbuckle/issues/964","repository_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle","labels_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle/issues/964/labels{/name}","comments_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle/issues/964/comments","events_url":"https://api.github.com/repos/domaindrivendev/Swashbuckle/issues/964/events","html_url":"https://github.com/domaindrivendev/Swashbuckle/issues/964","id":197120677,"number":964,"title":"Response Model Schema is coming as empty object in Swagger -  XML Comments","user":{"login":"JerryGoyal","id":7106086,"avatar_url":"https://avatars.githubusercontent.com/u/7106086?v=3","gravatar_id":"","url":"https://api.github.com/users/JerryGoyal","html_url":"https://github.com/JerryGoyal","followers_url":"https://api.github.com/users/JerryGoyal/followers","following_url":"https://api.github.com/users/JerryGoyal/following{/other_user}","gists_url":"https://api.github.com/users/JerryGoyal/gists{/gist_id}","starred_url":"https://api.github.com/users/JerryGoyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JerryGoyal/subscriptions","organizations_url":"https://api.github.com/users/JerryGoyal/orgs","repos_url":"https://api.github.com/users/JerryGoyal/repos","events_url":"https://api.github.com/users/JerryGoyal/events{/privacy}","received_events_url":"https://api.github.com/users/JerryGoyal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-22T08:33:24Z","updated_at":"2016-12-22T08:33:24Z","closed_at":null,"body":"I'm using latest version of Swashbuckle.\r\nIf I use `SwaggerResponse ` it works fine but not with XML Comments.\r\nThis is my API:\r\n\r\n    /// <summary>\r\n            /// Gets activity logs.\r\n            /// </summary>\r\n            /// <param name=\"locationId\">Location id.</param>\r\n            /// <param name=\"filter\">Activity log filter options.</param>\r\n            [ResponseType(typeof(ActivityLogResponse))]\r\n            public async Task<HttpResponseMessage> FetchActivityLogs(int locationId, ActivityLogFilterOptions filter)\r\n            {\r\n                try\r\n                {\r\n                    var response = await _activityLogLogic.GetActivityLogs(CHIdentity.User, locationId, filter);\r\n                    return Request.CreateResponse(HttpStatusCode.OK, response);\r\n                }\r\n                catch (HttpRequestException ex)\r\n                {\r\n                    return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message + \"\\n\" + ex.InnerException.Message);\r\n                }\r\n                catch (Exception ex)\r\n                {\r\n                    return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message);\r\n                }\r\n            }\r\n`IOperationFilter` Class:\r\n\r\n```\r\npublic class MultipleOperationsWithSameVerbFilter : IOperationFilter\r\n    {\r\n        public void Apply(\r\n            Operation operation,\r\n            SchemaRegistry schemaRegistry,\r\n            ApiDescription apiDescription)\r\n        {\r\n            //  List<string> lst = new List<string>();\r\n            if (operation.parameters != null)\r\n            {\r\n                operation.operationId += \"By\";\r\n                foreach (var parm in operation.parameters)\r\n                {\r\n                    operation.operationId += string.Format(\"{0}-{1}\", parm.name, Guid.NewGuid());//Some of the api are creating same operation Id. we have append param name and Guid of URI to avoid to create duplicatate operation ID\r\n\r\n                }\r\n\r\n            }\r\n        }\r\n    }\r\n```\r\n\r\nDefination of `ActivityLogResponse` class:\r\n\r\n     public class ActivityLogResponse\r\n        { \r\n           public List<ActivityLogMessage> ActivityLogs { get; set; }\r\n           Logs { get; set; }\r\n        }\r\n\r\nIn swagger JSON ***responses*** `\"type\": \"object\"` is coming instead of `ActivityLogFilterOptions`\r\n\r\nSee `Responses` in following Swagger Json:\r\n\r\n\t\t\"/api/locations/{locationId}/FetchActivityLogs\": {\r\n\t\t\t\"post\": {\r\n\t\t\t\t\"tags\": [\"ActivityLog\"],\r\n\t\t\t\t\"summary\": \"Gets activity logs.\",\r\n\t\t\t\t\"operationId\": \"ActivityLog_FetchActivityLogs\",\r\n\t\t\t\t\"consumes\": [\"application/json\", \"text/json\", \"application/xml\", \"text/xml\", \"application/x-www-form-urlencoded\"],\r\n\t\t\t\t\"produces\": [\"application/json\", \"text/json\", \"application/xml\", \"text/xml\"],\r\n\t\t\t\t\"parameters\": [{\r\n\t\t\t\t\t\t\"name\": \"locationId\",\r\n\t\t\t\t\t\t\"in\": \"path\",\r\n\t\t\t\t\t\t\"description\": \"Location id.\",\r\n\t\t\t\t\t\t\"required\": true,\r\n\t\t\t\t\t\t\"type\": \"integer\",\r\n\t\t\t\t\t\t\"format\": \"int32\"\r\n\t\t\t\t\t}, {\r\n\t\t\t\t\t\t\"name\": \"filter\",\r\n\t\t\t\t\t\t\"in\": \"body\",\r\n\t\t\t\t\t\t\"description\": \"Activity log filter options.\",\r\n\t\t\t\t\t\t\"required\": true,\r\n\t\t\t\t\t\t\"schema\": {\r\n\t\t\t\t\t\t\t\"$ref\": \"#/definitions/ActivityLogFilterOptions\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t],\r\n\t\t\t\t\"responses\": {\r\n\t\t\t\t\t\"200\": {\r\n\t\t\t\t\t\t\"description\": \"OK\",\r\n\t\t\t\t\t\t\"schema\": {\r\n\t\t\t\t\t\t\t\"type\": \"object\"\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n![image 2](https://cloud.githubusercontent.com/assets/7106086/21390059/da71dbaa-c7aa-11e6-9c47-e662f6f35dc0.png)\r\n\r\n\r\nHow to load `ActivityLogFilterOptions` here instead of `{}`?\r\n"}}
{"actor":{"display_login":"JerryGoyal"}}