{"action":"created","issue":{"url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/272","labels_url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/272/labels{/name}","comments_url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/272/comments","events_url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/272/events","html_url":"https://github.com/dennisdoomen/fluentassertions/issues/272","id":88240988,"number":272,"title":"Provide Nullness guarantees as attributes or external annotations","user":{"login":"arlobelshee","id":796063,"avatar_url":"https://avatars.githubusercontent.com/u/796063?v=3","gravatar_id":"","url":"https://api.github.com/users/arlobelshee","html_url":"https://github.com/arlobelshee","followers_url":"https://api.github.com/users/arlobelshee/followers","following_url":"https://api.github.com/users/arlobelshee/following{/other_user}","gists_url":"https://api.github.com/users/arlobelshee/gists{/gist_id}","starred_url":"https://api.github.com/users/arlobelshee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arlobelshee/subscriptions","organizations_url":"https://api.github.com/users/arlobelshee/orgs","repos_url":"https://api.github.com/users/arlobelshee/repos","events_url":"https://api.github.com/users/arlobelshee/events{/privacy}","received_events_url":"https://api.github.com/users/arlobelshee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-14T20:09:35Z","updated_at":"2015-06-15T19:40:14Z","closed_at":null,"body":"I generally use ReSharper's Null checking at the highest level. This lets me avoid any NREs. However, it requires that all instances of an object reference (param, field, return value) indicate nullness guarantee.\r\n\r\nI love FluentAssertions, but it doesn't indicate any nullness contracts. Which means I typically have to supply external annotations files. That becomes a pain with multiple projects, multiple machines to config, etc.\r\n\r\nIn the case of FuentAssertions, the main contract declaration that would be useful is [NotNull] on the return value of all the chaining methods. Secondary value would be [NotNull] or [CanBeNull] on parameter declarations for the extension methods.\r\n\r\nIt would be a lot simpler for me if the library included these contracts out of the box - via either Attributes (which requires taking a dependency on a R# NuGet package) or external annotations (which requires keeping an XML file up to date as things change). I generally find the attributes superior as ReSharper will remind me to keep them up to date and they are right next to the code they describe, but I recognize that some library authors are wary of adding dependencies.\r\n\r\nWould you accept a PR that specified contracts for your public API? Would you maintain it in subsequent releases? If so, which way would you prefer - attributes or external annotations?"},"comment":{"url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/comments/112183569","html_url":"https://github.com/dennisdoomen/fluentassertions/issues/272#issuecomment-112183569","issue_url":"https://api.github.com/repos/dennisdoomen/fluentassertions/issues/272","id":112183569,"user":{"login":"dennisdoomen","id":572734,"avatar_url":"https://avatars.githubusercontent.com/u/572734?v=3","gravatar_id":"","url":"https://api.github.com/users/dennisdoomen","html_url":"https://github.com/dennisdoomen","followers_url":"https://api.github.com/users/dennisdoomen/followers","following_url":"https://api.github.com/users/dennisdoomen/following{/other_user}","gists_url":"https://api.github.com/users/dennisdoomen/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisdoomen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisdoomen/subscriptions","organizations_url":"https://api.github.com/users/dennisdoomen/orgs","repos_url":"https://api.github.com/users/dennisdoomen/repos","events_url":"https://api.github.com/users/dennisdoomen/events{/privacy}","received_events_url":"https://api.github.com/users/dennisdoomen/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T19:40:14Z","updated_at":"2015-06-15T19:40:14Z","body":"After a [short discussion](https://gitter.im/dennisdoomen/fluentassertions?at=557e8fe97d5adaae3b4f116f), absolutely, provided that you'll use the internalized attributes so that we don't get a dependency on some kind of external NuGet package"}}