{"action":"created","comment":{"url":"https://api.github.com/repos/dunglas/php-schema/pulls/comments/37974681","id":37974681,"diff_hunk":"@@ -208,75 +207,19 @@ public function generate($config)\n                     continue;\n                 }\n \n-                // Warn when property are not part of GoodRelations\n-                if ($config['checkIsGoodRelations']) {\n-                    if (!$this->goodRelationsBridge->exist($property->localName())) {\n-                        $this->logger->warning(sprintf('The property \"%s\" (type \"%s\") is not part of GoodRelations.', $property->localName(), $type->localName()));\n-                    }\n-                }\n-\n-                // Ignore or warn when properties are legacy\n-                if (preg_match('/legacy spelling/', $property->get('rdfs:comment'))) {\n-                    if (isset($typeConfig['properties'])) {\n-                        $this->logger->warning(sprintf('The property \"%s\" (type \"%s\") is legacy.', $property->localName(), $type->localName()));\n-                    } else {\n-                        $this->logger->info(sprintf('The property \"%s\" (type \"%s\") is legacy. Ignoring.', $property->localName(), $type->localName()));\n-                        continue;\n-                    }\n-                }\n-\n-                $ranges = [];\n-                if (isset($typeConfig['properties'][$property->localName()]['range']) && $typeConfig['properties'][$property->localName()]['range']) {\n-                    $ranges[] = $typeConfig['properties'][$property->localName()]['range'];\n-                } else {\n-                    foreach ($property->all(self::SCHEMA_ORG_RANGE) as $range) {\n-                        if (!$typesDefined || $this->isDatatype($range->localName()) || isset($config['types'][$range->localName()])) {\n-                            $ranges[] = $range->localName();\n-                        }\n-                    }\n-                }\n-\n-                $numberOfRanges = count($ranges);\n-                if ($numberOfRanges === 0) {\n-                    $this->logger->error(sprintf('The property \"%s\" (type \"%s\") has an unknown type. Add its type to the config file.', $property->localName(), $type->localName()));\n-                } else {\n-                    if ($numberOfRanges > 1) {\n-                        $this->logger->error(sprintf('The property \"%s\" (type \"%s\") has several types. Using the first one.', $property->localName(), $type->localName()));\n-                    }\n+                $this->generateField($config, $class, $type, $property->localName(), $property);\n+            }\n \n-                    $cardinality = isset($typeConfig['properties'][$property->localName()]['cardinality']) ? $typeConfig['properties'][$property->localName()]['cardinality'] : false;\n-                    if (!$cardinality || $cardinality === CardinalitiesExtractor::CARDINALITY_UNKNOWN) {\n-                        $cardinality = $this->cardinalities[$property->localName()];\n-                    }\n+            // Add custom fields (non schema.org)\n+            if (is_array($typeConfig['properties'])) {\n+                foreach (array_diff_key($typeConfig['properties'], $class['fields']) as $propertyName => $property) {\n+                    $this->logger->warning(sprintf('The property \"%s\" (type \"%s\") is a custom property.', $propertyName, $type->localName()));","path":"src/SchemaOrgModel/TypesGenerator.php","position":66,"original_position":66,"commit_id":"f315daf3643e19bbf1c22cd95a62e7b980871651","original_commit_id":"f315daf3643e19bbf1c22cd95a62e7b980871651","user":{"login":"dunglas","id":57224,"avatar_url":"https://avatars.githubusercontent.com/u/57224?v=3","gravatar_id":"","url":"https://api.github.com/users/dunglas","html_url":"https://github.com/dunglas","followers_url":"https://api.github.com/users/dunglas/followers","following_url":"https://api.github.com/users/dunglas/following{/other_user}","gists_url":"https://api.github.com/users/dunglas/gists{/gist_id}","starred_url":"https://api.github.com/users/dunglas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dunglas/subscriptions","organizations_url":"https://api.github.com/users/dunglas/orgs","repos_url":"https://api.github.com/users/dunglas/repos","events_url":"https://api.github.com/users/dunglas/events{/privacy}","received_events_url":"https://api.github.com/users/dunglas/received_events","type":"User","site_admin":false},"body":"Maybe an `info` instead of a warning (this is a legit usage).","created_at":"2015-08-26T12:18:47Z","updated_at":"2015-08-26T12:18:47Z","html_url":"https://github.com/dunglas/php-schema/pull/19#discussion_r37974681","pull_request_url":"https://api.github.com/repos/dunglas/php-schema/pulls/19","_links":{"self":{"href":"https://api.github.com/repos/dunglas/php-schema/pulls/comments/37974681"},"html":{"href":"https://github.com/dunglas/php-schema/pull/19#discussion_r37974681"},"pull_request":{"href":"https://api.github.com/repos/dunglas/php-schema/pulls/19"}}},"pull_request":{"url":"https://api.github.com/repos/dunglas/php-schema/pulls/19","id":43380984,"html_url":"https://github.com/dunglas/php-schema/pull/19","diff_url":"https://github.com/dunglas/php-schema/pull/19.diff","patch_url":"https://github.com/dunglas/php-schema/pull/19.patch","issue_url":"https://api.github.com/repos/dunglas/php-schema/issues/19","number":19,"state":"open","locked":false,"title":"Feature custom field","user":{"login":"ZeBigDuck","id":858204,"avatar_url":"https://avatars.githubusercontent.com/u/858204?v=3","gravatar_id":"","url":"https://api.github.com/users/ZeBigDuck","html_url":"https://github.com/ZeBigDuck","followers_url":"https://api.github.com/users/ZeBigDuck/followers","following_url":"https://api.github.com/users/ZeBigDuck/following{/other_user}","gists_url":"https://api.github.com/users/ZeBigDuck/gists{/gist_id}","starred_url":"https://api.github.com/users/ZeBigDuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZeBigDuck/subscriptions","organizations_url":"https://api.github.com/users/ZeBigDuck/orgs","repos_url":"https://api.github.com/users/ZeBigDuck/repos","events_url":"https://api.github.com/users/ZeBigDuck/events{/privacy}","received_events_url":"https://api.github.com/users/ZeBigDuck/received_events","type":"User","site_admin":false},"body":"This allow user to add custom fields.\r\n\r\nThis way, you are able to create custom fields like any schema.org field, and they won't have `@Iri` annotation.\r\nGeneration will warn while generating custom fields.\r\n\r\n```yaml\r\n  Person:\r\n    properties:\r\n      familyName: ~\r\n      friends: { range: \"Person\", cardinality: (0..*) }\r\n```","created_at":"2015-08-26T09:25:17Z","updated_at":"2015-08-26T12:18:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"457e56940ca5df5ad17de097aa17b9b945e238fb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dunglas/php-schema/pulls/19/commits","review_comments_url":"https://api.github.com/repos/dunglas/php-schema/pulls/19/comments","review_comment_url":"https://api.github.com/repos/dunglas/php-schema/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dunglas/php-schema/issues/19/comments","statuses_url":"https://api.github.com/repos/dunglas/php-schema/statuses/f315daf3643e19bbf1c22cd95a62e7b980871651","head":{"label":"ZeBigDuck:feature-custom-field","ref":"feature-custom-field","sha":"f315daf3643e19bbf1c22cd95a62e7b980871651","user":{"login":"ZeBigDuck","id":858204,"avatar_url":"https://avatars.githubusercontent.com/u/858204?v=3","gravatar_id":"","url":"https://api.github.com/users/ZeBigDuck","html_url":"https://github.com/ZeBigDuck","followers_url":"https://api.github.com/users/ZeBigDuck/followers","following_url":"https://api.github.com/users/ZeBigDuck/following{/other_user}","gists_url":"https://api.github.com/users/ZeBigDuck/gists{/gist_id}","starred_url":"https://api.github.com/users/ZeBigDuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZeBigDuck/subscriptions","organizations_url":"https://api.github.com/users/ZeBigDuck/orgs","repos_url":"https://api.github.com/users/ZeBigDuck/repos","events_url":"https://api.github.com/users/ZeBigDuck/events{/privacy}","received_events_url":"https://api.github.com/users/ZeBigDuck/received_events","type":"User","site_admin":false},"repo":{"id":41252671,"name":"php-schema","full_name":"ZeBigDuck/php-schema","owner":{"login":"ZeBigDuck","id":858204,"avatar_url":"https://avatars.githubusercontent.com/u/858204?v=3","gravatar_id":"","url":"https://api.github.com/users/ZeBigDuck","html_url":"https://github.com/ZeBigDuck","followers_url":"https://api.github.com/users/ZeBigDuck/followers","following_url":"https://api.github.com/users/ZeBigDuck/following{/other_user}","gists_url":"https://api.github.com/users/ZeBigDuck/gists{/gist_id}","starred_url":"https://api.github.com/users/ZeBigDuck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZeBigDuck/subscriptions","organizations_url":"https://api.github.com/users/ZeBigDuck/orgs","repos_url":"https://api.github.com/users/ZeBigDuck/repos","events_url":"https://api.github.com/users/ZeBigDuck/events{/privacy}","received_events_url":"https://api.github.com/users/ZeBigDuck/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ZeBigDuck/php-schema","description":"PHP Model Scaffolding from Schema.org vocabulary","fork":true,"url":"https://api.github.com/repos/ZeBigDuck/php-schema","forks_url":"https://api.github.com/repos/ZeBigDuck/php-schema/forks","keys_url":"https://api.github.com/repos/ZeBigDuck/php-schema/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ZeBigDuck/php-schema/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ZeBigDuck/php-schema/teams","hooks_url":"https://api.github.com/repos/ZeBigDuck/php-schema/hooks","issue_events_url":"https://api.github.com/repos/ZeBigDuck/php-schema/issues/events{/number}","events_url":"https://api.github.com/repos/ZeBigDuck/php-schema/events","assignees_url":"https://api.github.com/repos/ZeBigDuck/php-schema/assignees{/user}","branches_url":"https://api.github.com/repos/ZeBigDuck/php-schema/branches{/branch}","tags_url":"https://api.github.com/repos/ZeBigDuck/php-schema/tags","blobs_url":"https://api.github.com/repos/ZeBigDuck/php-schema/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ZeBigDuck/php-schema/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ZeBigDuck/php-schema/git/refs{/sha}","trees_url":"https://api.github.com/repos/ZeBigDuck/php-schema/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ZeBigDuck/php-schema/statuses/{sha}","languages_url":"https://api.github.com/repos/ZeBigDuck/php-schema/languages","stargazers_url":"https://api.github.com/repos/ZeBigDuck/php-schema/stargazers","contributors_url":"https://api.github.com/repos/ZeBigDuck/php-schema/contributors","subscribers_url":"https://api.github.com/repos/ZeBigDuck/php-schema/subscribers","subscription_url":"https://api.github.com/repos/ZeBigDuck/php-schema/subscription","commits_url":"https://api.github.com/repos/ZeBigDuck/php-schema/commits{/sha}","git_commits_url":"https://api.github.com/repos/ZeBigDuck/php-schema/git/commits{/sha}","comments_url":"https://api.github.com/repos/ZeBigDuck/php-schema/comments{/number}","issue_comment_url":"https://api.github.com/repos/ZeBigDuck/php-schema/issues/comments{/number}","contents_url":"https://api.github.com/repos/ZeBigDuck/php-schema/contents/{+path}","compare_url":"https://api.github.com/repos/ZeBigDuck/php-schema/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ZeBigDuck/php-schema/merges","archive_url":"https://api.github.com/repos/ZeBigDuck/php-schema/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ZeBigDuck/php-schema/downloads","issues_url":"https://api.github.com/repos/ZeBigDuck/php-schema/issues{/number}","pulls_url":"https://api.github.com/repos/ZeBigDuck/php-schema/pulls{/number}","milestones_url":"https://api.github.com/repos/ZeBigDuck/php-schema/milestones{/number}","notifications_url":"https://api.github.com/repos/ZeBigDuck/php-schema/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ZeBigDuck/php-schema/labels{/name}","releases_url":"https://api.github.com/repos/ZeBigDuck/php-schema/releases{/id}","created_at":"2015-08-23T14:23:28Z","updated_at":"2015-08-23T14:23:29Z","pushed_at":"2015-08-26T11:25:49Z","git_url":"git://github.com/ZeBigDuck/php-schema.git","ssh_url":"git@github.com:ZeBigDuck/php-schema.git","clone_url":"https://github.com/ZeBigDuck/php-schema.git","svn_url":"https://github.com/ZeBigDuck/php-schema","homepage":"https://api-platform.com","size":1269,"stargazers_count":0,"watchers_count":0,"language":"Web Ontology Language","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dunglas:master","ref":"master","sha":"0e6b4b0adb3862965a50797422d5713c0916c2c4","user":{"login":"dunglas","id":57224,"avatar_url":"https://avatars.githubusercontent.com/u/57224?v=3","gravatar_id":"","url":"https://api.github.com/users/dunglas","html_url":"https://github.com/dunglas","followers_url":"https://api.github.com/users/dunglas/followers","following_url":"https://api.github.com/users/dunglas/following{/other_user}","gists_url":"https://api.github.com/users/dunglas/gists{/gist_id}","starred_url":"https://api.github.com/users/dunglas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dunglas/subscriptions","organizations_url":"https://api.github.com/users/dunglas/orgs","repos_url":"https://api.github.com/users/dunglas/repos","events_url":"https://api.github.com/users/dunglas/events{/privacy}","received_events_url":"https://api.github.com/users/dunglas/received_events","type":"User","site_admin":false},"repo":{"id":16409773,"name":"php-schema","full_name":"dunglas/php-schema","owner":{"login":"dunglas","id":57224,"avatar_url":"https://avatars.githubusercontent.com/u/57224?v=3","gravatar_id":"","url":"https://api.github.com/users/dunglas","html_url":"https://github.com/dunglas","followers_url":"https://api.github.com/users/dunglas/followers","following_url":"https://api.github.com/users/dunglas/following{/other_user}","gists_url":"https://api.github.com/users/dunglas/gists{/gist_id}","starred_url":"https://api.github.com/users/dunglas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dunglas/subscriptions","organizations_url":"https://api.github.com/users/dunglas/orgs","repos_url":"https://api.github.com/users/dunglas/repos","events_url":"https://api.github.com/users/dunglas/events{/privacy}","received_events_url":"https://api.github.com/users/dunglas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dunglas/php-schema","description":"PHP Model Scaffolding from Schema.org vocabulary","fork":false,"url":"https://api.github.com/repos/dunglas/php-schema","forks_url":"https://api.github.com/repos/dunglas/php-schema/forks","keys_url":"https://api.github.com/repos/dunglas/php-schema/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dunglas/php-schema/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dunglas/php-schema/teams","hooks_url":"https://api.github.com/repos/dunglas/php-schema/hooks","issue_events_url":"https://api.github.com/repos/dunglas/php-schema/issues/events{/number}","events_url":"https://api.github.com/repos/dunglas/php-schema/events","assignees_url":"https://api.github.com/repos/dunglas/php-schema/assignees{/user}","branches_url":"https://api.github.com/repos/dunglas/php-schema/branches{/branch}","tags_url":"https://api.github.com/repos/dunglas/php-schema/tags","blobs_url":"https://api.github.com/repos/dunglas/php-schema/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dunglas/php-schema/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dunglas/php-schema/git/refs{/sha}","trees_url":"https://api.github.com/repos/dunglas/php-schema/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dunglas/php-schema/statuses/{sha}","languages_url":"https://api.github.com/repos/dunglas/php-schema/languages","stargazers_url":"https://api.github.com/repos/dunglas/php-schema/stargazers","contributors_url":"https://api.github.com/repos/dunglas/php-schema/contributors","subscribers_url":"https://api.github.com/repos/dunglas/php-schema/subscribers","subscription_url":"https://api.github.com/repos/dunglas/php-schema/subscription","commits_url":"https://api.github.com/repos/dunglas/php-schema/commits{/sha}","git_commits_url":"https://api.github.com/repos/dunglas/php-schema/git/commits{/sha}","comments_url":"https://api.github.com/repos/dunglas/php-schema/comments{/number}","issue_comment_url":"https://api.github.com/repos/dunglas/php-schema/issues/comments{/number}","contents_url":"https://api.github.com/repos/dunglas/php-schema/contents/{+path}","compare_url":"https://api.github.com/repos/dunglas/php-schema/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dunglas/php-schema/merges","archive_url":"https://api.github.com/repos/dunglas/php-schema/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dunglas/php-schema/downloads","issues_url":"https://api.github.com/repos/dunglas/php-schema/issues{/number}","pulls_url":"https://api.github.com/repos/dunglas/php-schema/pulls{/number}","milestones_url":"https://api.github.com/repos/dunglas/php-schema/milestones{/number}","notifications_url":"https://api.github.com/repos/dunglas/php-schema/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dunglas/php-schema/labels{/name}","releases_url":"https://api.github.com/repos/dunglas/php-schema/releases{/id}","created_at":"2014-01-31T14:14:10Z","updated_at":"2015-08-16T15:58:22Z","pushed_at":"2015-08-26T11:25:49Z","git_url":"git://github.com/dunglas/php-schema.git","ssh_url":"git@github.com:dunglas/php-schema.git","clone_url":"https://github.com/dunglas/php-schema.git","svn_url":"https://github.com/dunglas/php-schema","homepage":"https://api-platform.com","size":1269,"stargazers_count":121,"watchers_count":121,"language":"Web Ontology Language","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":15,"mirror_url":null,"open_issues_count":8,"forks":15,"open_issues":8,"watchers":121,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dunglas/php-schema/pulls/19"},"html":{"href":"https://github.com/dunglas/php-schema/pull/19"},"issue":{"href":"https://api.github.com/repos/dunglas/php-schema/issues/19"},"comments":{"href":"https://api.github.com/repos/dunglas/php-schema/issues/19/comments"},"review_comments":{"href":"https://api.github.com/repos/dunglas/php-schema/pulls/19/comments"},"review_comment":{"href":"https://api.github.com/repos/dunglas/php-schema/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dunglas/php-schema/pulls/19/commits"},"statuses":{"href":"https://api.github.com/repos/dunglas/php-schema/statuses/f315daf3643e19bbf1c22cd95a62e7b980871651"}}}}