{"action":"closed","issue":{"url":"https://api.github.com/repos/Azure/autorest/issues/816","repository_url":"https://api.github.com/repos/Azure/autorest","labels_url":"https://api.github.com/repos/Azure/autorest/issues/816/labels{/name}","comments_url":"https://api.github.com/repos/Azure/autorest/issues/816/comments","events_url":"https://api.github.com/repos/Azure/autorest/issues/816/events","html_url":"https://github.com/Azure/autorest/issues/816","id":139075453,"number":816,"title":"Nullable int property on response model for element that will always be present.","user":{"login":"NiklasGustafsson","id":1791495,"avatar_url":"https://avatars.githubusercontent.com/u/1791495?v=3","gravatar_id":"","url":"https://api.github.com/users/NiklasGustafsson","html_url":"https://github.com/NiklasGustafsson","followers_url":"https://api.github.com/users/NiklasGustafsson/followers","following_url":"https://api.github.com/users/NiklasGustafsson/following{/other_user}","gists_url":"https://api.github.com/users/NiklasGustafsson/gists{/gist_id}","starred_url":"https://api.github.com/users/NiklasGustafsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NiklasGustafsson/subscriptions","organizations_url":"https://api.github.com/users/NiklasGustafsson/orgs","repos_url":"https://api.github.com/users/NiklasGustafsson/repos","events_url":"https://api.github.com/users/NiklasGustafsson/events{/privacy}","received_events_url":"https://api.github.com/users/NiklasGustafsson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"fearthecowboy","id":133736,"avatar_url":"https://avatars.githubusercontent.com/u/133736?v=3","gravatar_id":"","url":"https://api.github.com/users/fearthecowboy","html_url":"https://github.com/fearthecowboy","followers_url":"https://api.github.com/users/fearthecowboy/followers","following_url":"https://api.github.com/users/fearthecowboy/following{/other_user}","gists_url":"https://api.github.com/users/fearthecowboy/gists{/gist_id}","starred_url":"https://api.github.com/users/fearthecowboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fearthecowboy/subscriptions","organizations_url":"https://api.github.com/users/fearthecowboy/orgs","repos_url":"https://api.github.com/users/fearthecowboy/repos","events_url":"https://api.github.com/users/fearthecowboy/events{/privacy}","received_events_url":"https://api.github.com/users/fearthecowboy/received_events","type":"User","site_admin":false},"assignees":[{"login":"fearthecowboy","id":133736,"avatar_url":"https://avatars.githubusercontent.com/u/133736?v=3","gravatar_id":"","url":"https://api.github.com/users/fearthecowboy","html_url":"https://github.com/fearthecowboy","followers_url":"https://api.github.com/users/fearthecowboy/followers","following_url":"https://api.github.com/users/fearthecowboy/following{/other_user}","gists_url":"https://api.github.com/users/fearthecowboy/gists{/gist_id}","starred_url":"https://api.github.com/users/fearthecowboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fearthecowboy/subscriptions","organizations_url":"https://api.github.com/users/fearthecowboy/orgs","repos_url":"https://api.github.com/users/fearthecowboy/repos","events_url":"https://api.github.com/users/fearthecowboy/events{/privacy}","received_events_url":"https://api.github.com/users/fearthecowboy/received_events","type":"User","site_admin":false},{"login":"olydis","id":9320958,"avatar_url":"https://avatars.githubusercontent.com/u/9320958?v=3","gravatar_id":"","url":"https://api.github.com/users/olydis","html_url":"https://github.com/olydis","followers_url":"https://api.github.com/users/olydis/followers","following_url":"https://api.github.com/users/olydis/following{/other_user}","gists_url":"https://api.github.com/users/olydis/gists{/gist_id}","starred_url":"https://api.github.com/users/olydis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olydis/subscriptions","organizations_url":"https://api.github.com/users/olydis/orgs","repos_url":"https://api.github.com/users/olydis/repos","events_url":"https://api.github.com/users/olydis/events{/privacy}","received_events_url":"https://api.github.com/users/olydis/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Azure/autorest/milestones/8","html_url":"https://github.com/Azure/autorest/milestones/1.0","labels_url":"https://api.github.com/repos/Azure/autorest/milestones/8/labels","id":1829639,"number":8,"title":"1.0","description":"","creator":{"login":"fearthecowboy","id":133736,"avatar_url":"https://avatars.githubusercontent.com/u/133736?v=3","gravatar_id":"","url":"https://api.github.com/users/fearthecowboy","html_url":"https://github.com/fearthecowboy","followers_url":"https://api.github.com/users/fearthecowboy/followers","following_url":"https://api.github.com/users/fearthecowboy/following{/other_user}","gists_url":"https://api.github.com/users/fearthecowboy/gists{/gist_id}","starred_url":"https://api.github.com/users/fearthecowboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fearthecowboy/subscriptions","organizations_url":"https://api.github.com/users/fearthecowboy/orgs","repos_url":"https://api.github.com/users/fearthecowboy/repos","events_url":"https://api.github.com/users/fearthecowboy/events{/privacy}","received_events_url":"https://api.github.com/users/fearthecowboy/received_events","type":"User","site_admin":false},"open_issues":26,"closed_issues":14,"state":"open","created_at":"2016-06-15T17:14:21Z","updated_at":"2016-11-08T02:59:44Z","due_on":"2017-02-28T00:00:00Z","closed_at":null},"comments":8,"created_at":"2016-03-07T19:49:18Z","updated_at":"2016-11-08T02:59:44Z","closed_at":"2016-11-08T02:59:44Z","body":"I have a response-payload model with this property:\n\n``` json\n\"_count\": {\n    \"type\": \"integer\",\n    \"readOnly\": true,\n    \"default\": 0,\n    \"description\": \"This property shows the number of databases returned as part of list operation.\"\n},\n```\n\nSince it's a response model, whether it's required or not is not a big client-side concern, but getting good code generated is. The element will always be there, and it doesn't make any sense for it to be writable.\n\nHowever, Swagger won't allow me to make it required **and** read-only, so I thought adding a default value might force it to use a non-nullable value type, but that's not the case:\n\n``` csharp\n        /// <summary>\n        /// This property shows the number of databases returned as part of\n        /// list operation.\n        /// </summary>\n        [JsonProperty(PropertyName = \"_count\")]\n        public int? _count { get; private set; }\n```\n\nAs far as I can tell, there is no means to force use of a regular value type here. I suggest that a readOnly element with an explicit default value be used to indicate that 'null' will never be an issue.\n\n<!---@tfsbridge:{\"tfsId\":5902468}-->\n"}}
{"actor":{"display_login":"fearthecowboy"}}