{"action":"created","comment":{"url":"https://api.github.com/repos/apiaryio/drafter/pulls/comments/75129662","id":75129662,"diff_hunk":"@@ -917,11 +917,49 @@ namespace drafter {\n         }\n     };\n \n+    static void CheckTypeAttributesClash(const mson::TypeAttributes& attributes,\n+                                         const snowcrash::SourceMap<mson::ValueDefinition>& sourceMap,\n+                                         ConversionContext& context) {\n+\n+        if ((attributes & mson::FixedTypeAttribute) != 0 &&\n+            (attributes & mson::OptionalTypeAttribute) != 0) {\n+\n+            context.warn(snowcrash::Warning(\"cannot use 'fixed' and 'optional' together\",\n+                                            snowcrash::MSONError, sourceMap.sourceMap));\n+        }\n+\n+        if ((attributes & mson::RequiredTypeAttribute) != 0 &&\n+            (attributes & mson::OptionalTypeAttribute) != 0) {\n+\n+            context.warn(snowcrash::Warning(\"cannot use 'required' and 'optional' together\",\n+                                            snowcrash::MSONError, sourceMap.sourceMap));\n+        }\n+\n+        if ((attributes & mson::DefaultTypeAttribute) != 0 &&\n+            (attributes & mson::SampleTypeAttribute) != 0) {\n+\n+            context.warn(snowcrash::Warning(\"cannot use 'default' and 'sample' together\",\n+                                            snowcrash::MSONError, sourceMap.sourceMap));\n+        }\n+\n+        if ((attributes & mson::FixedTypeAttribute) != 0 &&\n+            (attributes & mson::FixedTypeTypeAttribute) != 0) {\n+\n+            context.warn(snowcrash::Warning(\"cannot use 'fixed' and 'fixed-type' together\",\n+                                            snowcrash::MSONError, sourceMap.sourceMap));\n+        }\n+    }\n+\n     template <typename Trait>\n     static refract::IElement* MsonMemberToRefract(const typename Trait::InputType& input,\n                                                   ConversionContext& context,\n                                                   const mson::BaseTypeName nameType,\n-                                                  const mson::BaseTypeName defaultNestedType) {\n+                                                  const mson::BaseTypeName defaultNestedType,\n+                                                  bool checkTypeAttributes = true) {","path":"src/RefractDataStructure.cc","position":52,"original_position":52,"commit_id":"3cac2d833729bd23dfc6248da081e68514bca5c6","original_commit_id":"3cac2d833729bd23dfc6248da081e68514bca5c6","user":{"login":"pksunkara","id":174703,"avatar_url":"https://avatars.githubusercontent.com/u/174703?v=3","gravatar_id":"","url":"https://api.github.com/users/pksunkara","html_url":"https://github.com/pksunkara","followers_url":"https://api.github.com/users/pksunkara/followers","following_url":"https://api.github.com/users/pksunkara/following{/other_user}","gists_url":"https://api.github.com/users/pksunkara/gists{/gist_id}","starred_url":"https://api.github.com/users/pksunkara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pksunkara/subscriptions","organizations_url":"https://api.github.com/users/pksunkara/orgs","repos_url":"https://api.github.com/users/pksunkara/repos","events_url":"https://api.github.com/users/pksunkara/events{/privacy}","received_events_url":"https://api.github.com/users/pksunkara/received_events","type":"User","site_admin":false},"body":"If the check happens more than once, we will get duplicate warnings. I guess, with the introduction of `context.warn` we can remove this part but logically this is still correct. What do you guys think?","created_at":"2016-08-17T14:08:28Z","updated_at":"2016-08-17T14:08:28Z","html_url":"https://github.com/apiaryio/drafter/pull/375#discussion_r75129662","pull_request_url":"https://api.github.com/repos/apiaryio/drafter/pulls/375","_links":{"self":{"href":"https://api.github.com/repos/apiaryio/drafter/pulls/comments/75129662"},"html":{"href":"https://github.com/apiaryio/drafter/pull/375#discussion_r75129662"},"pull_request":{"href":"https://api.github.com/repos/apiaryio/drafter/pulls/375"}}},"pull_request":{"url":"https://api.github.com/repos/apiaryio/drafter/pulls/375","id":81629223,"html_url":"https://github.com/apiaryio/drafter/pull/375","diff_url":"https://github.com/apiaryio/drafter/pull/375.diff","patch_url":"https://github.com/apiaryio/drafter/pull/375.patch","issue_url":"https://api.github.com/repos/apiaryio/drafter/issues/375","number":375,"state":"open","locked":false,"title":"Added check for contradictory type attributes","user":{"login":"pksunkara","id":174703,"avatar_url":"https://avatars.githubusercontent.com/u/174703?v=3","gravatar_id":"","url":"https://api.github.com/users/pksunkara","html_url":"https://github.com/pksunkara","followers_url":"https://api.github.com/users/pksunkara/followers","following_url":"https://api.github.com/users/pksunkara/following{/other_user}","gists_url":"https://api.github.com/users/pksunkara/gists{/gist_id}","starred_url":"https://api.github.com/users/pksunkara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pksunkara/subscriptions","organizations_url":"https://api.github.com/users/pksunkara/orgs","repos_url":"https://api.github.com/users/pksunkara/repos","events_url":"https://api.github.com/users/pksunkara/events{/privacy}","received_events_url":"https://api.github.com/users/pksunkara/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-17T11:53:04Z","updated_at":"2016-08-17T14:08:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a39fffc79bae6a03961c7ad72a8a6aad7b1e5ac","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apiaryio/drafter/pulls/375/commits","review_comments_url":"https://api.github.com/repos/apiaryio/drafter/pulls/375/comments","review_comment_url":"https://api.github.com/repos/apiaryio/drafter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apiaryio/drafter/issues/375/comments","statuses_url":"https://api.github.com/repos/apiaryio/drafter/statuses/3cac2d833729bd23dfc6248da081e68514bca5c6","head":{"label":"apiaryio:pksunkara/clash-of-attributes","ref":"pksunkara/clash-of-attributes","sha":"3cac2d833729bd23dfc6248da081e68514bca5c6","user":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"repo":{"id":30541396,"name":"drafter","full_name":"apiaryio/drafter","owner":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apiaryio/drafter","description":"Snow Crash parser harness","fork":false,"url":"https://api.github.com/repos/apiaryio/drafter","forks_url":"https://api.github.com/repos/apiaryio/drafter/forks","keys_url":"https://api.github.com/repos/apiaryio/drafter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apiaryio/drafter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apiaryio/drafter/teams","hooks_url":"https://api.github.com/repos/apiaryio/drafter/hooks","issue_events_url":"https://api.github.com/repos/apiaryio/drafter/issues/events{/number}","events_url":"https://api.github.com/repos/apiaryio/drafter/events","assignees_url":"https://api.github.com/repos/apiaryio/drafter/assignees{/user}","branches_url":"https://api.github.com/repos/apiaryio/drafter/branches{/branch}","tags_url":"https://api.github.com/repos/apiaryio/drafter/tags","blobs_url":"https://api.github.com/repos/apiaryio/drafter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apiaryio/drafter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apiaryio/drafter/git/refs{/sha}","trees_url":"https://api.github.com/repos/apiaryio/drafter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apiaryio/drafter/statuses/{sha}","languages_url":"https://api.github.com/repos/apiaryio/drafter/languages","stargazers_url":"https://api.github.com/repos/apiaryio/drafter/stargazers","contributors_url":"https://api.github.com/repos/apiaryio/drafter/contributors","subscribers_url":"https://api.github.com/repos/apiaryio/drafter/subscribers","subscription_url":"https://api.github.com/repos/apiaryio/drafter/subscription","commits_url":"https://api.github.com/repos/apiaryio/drafter/commits{/sha}","git_commits_url":"https://api.github.com/repos/apiaryio/drafter/git/commits{/sha}","comments_url":"https://api.github.com/repos/apiaryio/drafter/comments{/number}","issue_comment_url":"https://api.github.com/repos/apiaryio/drafter/issues/comments{/number}","contents_url":"https://api.github.com/repos/apiaryio/drafter/contents/{+path}","compare_url":"https://api.github.com/repos/apiaryio/drafter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apiaryio/drafter/merges","archive_url":"https://api.github.com/repos/apiaryio/drafter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apiaryio/drafter/downloads","issues_url":"https://api.github.com/repos/apiaryio/drafter/issues{/number}","pulls_url":"https://api.github.com/repos/apiaryio/drafter/pulls{/number}","milestones_url":"https://api.github.com/repos/apiaryio/drafter/milestones{/number}","notifications_url":"https://api.github.com/repos/apiaryio/drafter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apiaryio/drafter/labels{/name}","releases_url":"https://api.github.com/repos/apiaryio/drafter/releases{/id}","deployments_url":"https://api.github.com/repos/apiaryio/drafter/deployments","created_at":"2015-02-09T15:05:57Z","updated_at":"2016-08-16T07:15:13Z","pushed_at":"2016-08-17T12:44:43Z","git_url":"git://github.com/apiaryio/drafter.git","ssh_url":"git@github.com:apiaryio/drafter.git","clone_url":"https://github.com/apiaryio/drafter.git","svn_url":"https://github.com/apiaryio/drafter","homepage":"","size":2057,"stargazers_count":124,"watchers_count":124,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":21,"forks":32,"open_issues":21,"watchers":124,"default_branch":"master"}},"base":{"label":"apiaryio:master","ref":"master","sha":"ec51ecb9cd5fbd6f1f765a47e842fe42979a21e6","user":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"repo":{"id":30541396,"name":"drafter","full_name":"apiaryio/drafter","owner":{"login":"apiaryio","id":765943,"avatar_url":"https://avatars.githubusercontent.com/u/765943?v=3","gravatar_id":"","url":"https://api.github.com/users/apiaryio","html_url":"https://github.com/apiaryio","followers_url":"https://api.github.com/users/apiaryio/followers","following_url":"https://api.github.com/users/apiaryio/following{/other_user}","gists_url":"https://api.github.com/users/apiaryio/gists{/gist_id}","starred_url":"https://api.github.com/users/apiaryio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apiaryio/subscriptions","organizations_url":"https://api.github.com/users/apiaryio/orgs","repos_url":"https://api.github.com/users/apiaryio/repos","events_url":"https://api.github.com/users/apiaryio/events{/privacy}","received_events_url":"https://api.github.com/users/apiaryio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apiaryio/drafter","description":"Snow Crash parser harness","fork":false,"url":"https://api.github.com/repos/apiaryio/drafter","forks_url":"https://api.github.com/repos/apiaryio/drafter/forks","keys_url":"https://api.github.com/repos/apiaryio/drafter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apiaryio/drafter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apiaryio/drafter/teams","hooks_url":"https://api.github.com/repos/apiaryio/drafter/hooks","issue_events_url":"https://api.github.com/repos/apiaryio/drafter/issues/events{/number}","events_url":"https://api.github.com/repos/apiaryio/drafter/events","assignees_url":"https://api.github.com/repos/apiaryio/drafter/assignees{/user}","branches_url":"https://api.github.com/repos/apiaryio/drafter/branches{/branch}","tags_url":"https://api.github.com/repos/apiaryio/drafter/tags","blobs_url":"https://api.github.com/repos/apiaryio/drafter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apiaryio/drafter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apiaryio/drafter/git/refs{/sha}","trees_url":"https://api.github.com/repos/apiaryio/drafter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apiaryio/drafter/statuses/{sha}","languages_url":"https://api.github.com/repos/apiaryio/drafter/languages","stargazers_url":"https://api.github.com/repos/apiaryio/drafter/stargazers","contributors_url":"https://api.github.com/repos/apiaryio/drafter/contributors","subscribers_url":"https://api.github.com/repos/apiaryio/drafter/subscribers","subscription_url":"https://api.github.com/repos/apiaryio/drafter/subscription","commits_url":"https://api.github.com/repos/apiaryio/drafter/commits{/sha}","git_commits_url":"https://api.github.com/repos/apiaryio/drafter/git/commits{/sha}","comments_url":"https://api.github.com/repos/apiaryio/drafter/comments{/number}","issue_comment_url":"https://api.github.com/repos/apiaryio/drafter/issues/comments{/number}","contents_url":"https://api.github.com/repos/apiaryio/drafter/contents/{+path}","compare_url":"https://api.github.com/repos/apiaryio/drafter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apiaryio/drafter/merges","archive_url":"https://api.github.com/repos/apiaryio/drafter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apiaryio/drafter/downloads","issues_url":"https://api.github.com/repos/apiaryio/drafter/issues{/number}","pulls_url":"https://api.github.com/repos/apiaryio/drafter/pulls{/number}","milestones_url":"https://api.github.com/repos/apiaryio/drafter/milestones{/number}","notifications_url":"https://api.github.com/repos/apiaryio/drafter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apiaryio/drafter/labels{/name}","releases_url":"https://api.github.com/repos/apiaryio/drafter/releases{/id}","deployments_url":"https://api.github.com/repos/apiaryio/drafter/deployments","created_at":"2015-02-09T15:05:57Z","updated_at":"2016-08-16T07:15:13Z","pushed_at":"2016-08-17T12:44:43Z","git_url":"git://github.com/apiaryio/drafter.git","ssh_url":"git@github.com:apiaryio/drafter.git","clone_url":"https://github.com/apiaryio/drafter.git","svn_url":"https://github.com/apiaryio/drafter","homepage":"","size":2057,"stargazers_count":124,"watchers_count":124,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":21,"forks":32,"open_issues":21,"watchers":124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apiaryio/drafter/pulls/375"},"html":{"href":"https://github.com/apiaryio/drafter/pull/375"},"issue":{"href":"https://api.github.com/repos/apiaryio/drafter/issues/375"},"comments":{"href":"https://api.github.com/repos/apiaryio/drafter/issues/375/comments"},"review_comments":{"href":"https://api.github.com/repos/apiaryio/drafter/pulls/375/comments"},"review_comment":{"href":"https://api.github.com/repos/apiaryio/drafter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apiaryio/drafter/pulls/375/commits"},"statuses":{"href":"https://api.github.com/repos/apiaryio/drafter/statuses/3cac2d833729bd23dfc6248da081e68514bca5c6"}}}}
{"actor":{"display_login":"pksunkara"}}