{"action":"created","comment":{"url":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/comments/234448868","pull_request_review_id":176092827,"id":234448868,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDQ0ODg2OA==","diff_hunk":"@@ -0,0 +1,392 @@\n+from datetime import date, datetime, time, timedelta\n+from decimal import Decimal\n+from enum import Enum\n+from pathlib import Path\n+from typing import Any, Dict, Sequence, Set, Tuple, Type\n+from uuid import UUID\n+\n+from . import main\n+from .fields import Field, Shape\n+from .json import pydantic_encoder\n+from .types import DSN, UUID1, UUID3, UUID4, UUID5, DirectoryPath, EmailStr, FilePath, Json, NameEmail, UrlStr\n+from .utils import clean_docstring\n+\n+\n+def get_flat_models_from_model(model: Type['main.BaseModel']) -> Set[Type['main.BaseModel']]:\n+    flat_models: Set[Type[main.BaseModel]] = set()\n+    assert issubclass(model, main.BaseModel)\n+    flat_models.add(model)\n+    for field in model.__fields__.values():\n+        flat_models = flat_models | get_flat_models_from_field(field)\n+    return flat_models\n+\n+\n+def get_flat_models_from_field(field: Field) -> Set[Type['main.BaseModel']]:\n+    flat_models: Set[Type[main.BaseModel]] = set()\n+    if field.sub_fields:\n+        flat_models = flat_models | get_flat_models_from_sub_fields(field.sub_fields)\n+    elif isinstance(field.type_, type) and issubclass(field.type_, main.BaseModel):\n+        flat_models = flat_models | get_flat_models_from_model(field.type_)\n+    return flat_models\n+\n+\n+def get_flat_models_from_sub_fields(fields) -> Set[Type['main.BaseModel']]:\n+    flat_models: Set[Type[main.BaseModel]] = set()\n+    for field in fields:\n+        flat_models = flat_models | get_flat_models_from_field(field)\n+    return flat_models\n+\n+\n+def get_flat_models_from_models(models: Sequence[Type['main.BaseModel']]) -> Set[Type['main.BaseModel']]:\n+    flat_models: Set[Type[main.BaseModel]] = set()\n+    for model in models:\n+        flat_models = flat_models | get_flat_models_from_model(model)\n+    return flat_models\n+\n+\n+def get_long_model_name(model: Type['main.BaseModel']):\n+    assert issubclass(model, main.BaseModel)\n+    prefix = model.__module__.replace('.', '__')\n+    name = model.__name__\n+    return f'{prefix}__{name}'\n+\n+\n+def get_model_name_maps(\n+    unique_models: Set[Type['main.BaseModel']]\n+) -> Tuple[Dict[str, Type['main.BaseModel']], Dict[Type['main.BaseModel'], str]]:\n+    name_model_map: Dict[str, Type[main.BaseModel]] = {}\n+    conflicting_names: Set[str] = set()\n+    for model in unique_models:\n+        model_name = model.__name__\n+        if model_name in conflicting_names:\n+            model_name = get_long_model_name(model)\n+            name_model_map[model_name] = model\n+        elif model_name in name_model_map:\n+            conflicting_names.add(model_name)\n+            conflicting_model = name_model_map[model_name]\n+            del name_model_map[model_name]\n+            conflicting_model_name = get_long_model_name(conflicting_model)\n+            name_model_map[conflicting_model_name] = conflicting_model\n+            model_name = get_long_model_name(model)\n+            name_model_map[model_name] = model","path":"pydantic/schema.py","position":71,"original_position":71,"commit_id":"5c0f21da183bbfa45bdf41c50dd288ccf6dd0bd7","original_commit_id":"49f369098e3f827e6075691866256a3985c0de88","user":{"login":"samuelcolvin","id":4039449,"node_id":"MDQ6VXNlcjQwMzk0NDk=","avatar_url":"https://avatars3.githubusercontent.com/u/4039449?v=4","gravatar_id":"","url":"https://api.github.com/users/samuelcolvin","html_url":"https://github.com/samuelcolvin","followers_url":"https://api.github.com/users/samuelcolvin/followers","following_url":"https://api.github.com/users/samuelcolvin/following{/other_user}","gists_url":"https://api.github.com/users/samuelcolvin/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelcolvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelcolvin/subscriptions","organizations_url":"https://api.github.com/users/samuelcolvin/orgs","repos_url":"https://api.github.com/users/samuelcolvin/repos","events_url":"https://api.github.com/users/samuelcolvin/events{/privacy}","received_events_url":"https://api.github.com/users/samuelcolvin/received_events","type":"User","site_admin":false},"body":"again this can be made more concise by combining to\r\n\r\n```py\r\nname_model_map[get_long_model_name(conflicting_model)] = conflicting_model\r\nname_model_map[get_long_model_name(model)] = model\r\n```","created_at":"2018-11-18T15:13:52Z","updated_at":"2018-11-18T15:31:37Z","html_url":"https://github.com/samuelcolvin/pydantic/pull/308#discussion_r234448868","pull_request_url":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/308","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/comments/234448868"},"html":{"href":"https://github.com/samuelcolvin/pydantic/pull/308#discussion_r234448868"},"pull_request":{"href":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/308"}}},"pull_request":{"url":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/308","id":231739616,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxNzM5NjE2","html_url":"https://github.com/samuelcolvin/pydantic/pull/308","diff_url":"https://github.com/samuelcolvin/pydantic/pull/308.diff","patch_url":"https://github.com/samuelcolvin/pydantic/pull/308.patch","issue_url":"https://api.github.com/repos/samuelcolvin/pydantic/issues/308","number":308,"state":"open","locked":false,"title":"JSON Schema update/refactor/augment, to conform to spec","user":{"login":"tiangolo","id":1326112,"node_id":"MDQ6VXNlcjEzMjYxMTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1326112?v=4","gravatar_id":"","url":"https://api.github.com/users/tiangolo","html_url":"https://github.com/tiangolo","followers_url":"https://api.github.com/users/tiangolo/followers","following_url":"https://api.github.com/users/tiangolo/following{/other_user}","gists_url":"https://api.github.com/users/tiangolo/gists{/gist_id}","starred_url":"https://api.github.com/users/tiangolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiangolo/subscriptions","organizations_url":"https://api.github.com/users/tiangolo/orgs","repos_url":"https://api.github.com/users/tiangolo/repos","events_url":"https://api.github.com/users/tiangolo/events{/privacy}","received_events_url":"https://api.github.com/users/tiangolo/received_events","type":"User","site_admin":false},"body":"<!-- Thank you for your contribution! -->\r\n<!-- Don't worry about making lots of commits on a pull request, they'll be squashed on merge anyway -->\r\n\r\n## Update/augment JSON Schema implementation to conform to [JSON Schema spec](http://json-schema.org/)\r\n\r\n## Note\r\n\r\nI renamed `BaseModel.schema_json` to `BaseModel.schema_str`, as it was a bit confusing for me the first time I tried Pydantic. As this is a change mostly related to \"taste\", let me know if you want me to revert it. Or maybe rename it to something like `schema_dump`.\r\n\r\n### Description\r\n\r\n* Generated JSON schema from a model is now fully conforming to the JSON Schema spec\r\n* Added a lot of logic to declare special and custom types, including:\r\n  * Date and time types\r\n  * Pydantic's types, including constraints, as `max_length`, `regex`, etc.\r\n* Types are mapped to match as possible the specs for JSON Schema Core, JSON Schema Validation and OpenAPI. E.g. `EmailStr` generates a `\"type\": \"string\", \"format\": \"email\"`, equivalent for `datetime`. `bytes` get a `\"format\": \"binary\"`, although there is no equivalent in JSON Schema, that is the format defined in OpenAPI, etc.\r\n* Refactor all schema handling out of the main classes\r\n* Models are defined in a separate `definitions` key, this allows better re-use of the definitions\r\n  * Only applies for models and when not overwritten (with default values, custom `title`, etc)\r\n* Models defined in `definitions` key are checked and processed to have unique names, so `modulea.Model` will be named `Model` if there is no competing class, but if there is a `moduleb.Model`, both models will have corresponding unique names (`modulea__Model` and `moduleb__Model`)\r\n* utility function to generate a single JSON Schema with definitions from several models that can be re-utilized (e.g. in OpenAPI `components`).\r\n* Update all (or most of) the tests for JSON Schema\r\n* Add many new tests to check all the new functionality\r\n* I plan on reviewing the tests again and augment them if necessary once we check that these changes seem acceptable. After that, I'll update the docs for Schema generation.\r\n\r\n<!-- Please give a short summary of the changes. -->\r\n\r\n## Related issue number\r\n\r\n#291\r\n\r\n<!-- Are there any issues opened that will be resolved by merging this change? -->\r\n\r\n## Performance Changes\r\n\r\npydantic cares about performance, if there's any risk performance changed on this PR, \r\nplease run `make benchmark-pydantic` before and after the change:\r\n* before: **?**\r\n* after: **?**\r\n\r\nJSON Schemas are generaly only run once, and are also cached. As they are more like a \"colateral\" feature that is not involved in the normal worflow of Pydantic, I don't think performance could be affected or relevant for this PR.\r\n\r\n## Checklist\r\n\r\n* [x] Unit tests for the changes exist\r\n* [x] Tests pass on CI and coverage remains at 100%: Test coverage for the new module at 100%. Added tests for utils to cover stuff that was covered with the previous implementation.\r\n* [x] Documentation reflects the changes: Docs for Schema JSON were updated accordingly, as thoroughly and clear as possible.\r\n* [ :thinking:  ] No performance deterioration (if applicable): I think it doesn't apply to this PR.\r\n* [x] `HISTORY.rst` has been updated: Updated.\r\n  * if this is the first change since a release, please add a new section\r\n  * include the issue number or this pull request number `#<number>`\r\n  * if you're not a regular contributer please include your github username `@whatever`\r\n","created_at":"2018-11-17T17:19:43Z","updated_at":"2018-11-18T15:31:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"560ff53d97525b4c46fa4a7c1f4f2049faa6ac61","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/308/commits","review_comments_url":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/308/comments","review_comment_url":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/samuelcolvin/pydantic/issues/308/comments","statuses_url":"https://api.github.com/repos/samuelcolvin/pydantic/statuses/5c0f21da183bbfa45bdf41c50dd288ccf6dd0bd7","head":{"label":"tiangolo:json-schema-flat","ref":"json-schema-flat","sha":"5c0f21da183bbfa45bdf41c50dd288ccf6dd0bd7","user":{"login":"tiangolo","id":1326112,"node_id":"MDQ6VXNlcjEzMjYxMTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1326112?v=4","gravatar_id":"","url":"https://api.github.com/users/tiangolo","html_url":"https://github.com/tiangolo","followers_url":"https://api.github.com/users/tiangolo/followers","following_url":"https://api.github.com/users/tiangolo/following{/other_user}","gists_url":"https://api.github.com/users/tiangolo/gists{/gist_id}","starred_url":"https://api.github.com/users/tiangolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiangolo/subscriptions","organizations_url":"https://api.github.com/users/tiangolo/orgs","repos_url":"https://api.github.com/users/tiangolo/repos","events_url":"https://api.github.com/users/tiangolo/events{/privacy}","received_events_url":"https://api.github.com/users/tiangolo/received_events","type":"User","site_admin":false},"repo":{"id":153972955,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM5NzI5NTU=","name":"pydantic","full_name":"tiangolo/pydantic","private":false,"owner":{"login":"tiangolo","id":1326112,"node_id":"MDQ6VXNlcjEzMjYxMTI=","avatar_url":"https://avatars0.githubusercontent.com/u/1326112?v=4","gravatar_id":"","url":"https://api.github.com/users/tiangolo","html_url":"https://github.com/tiangolo","followers_url":"https://api.github.com/users/tiangolo/followers","following_url":"https://api.github.com/users/tiangolo/following{/other_user}","gists_url":"https://api.github.com/users/tiangolo/gists{/gist_id}","starred_url":"https://api.github.com/users/tiangolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiangolo/subscriptions","organizations_url":"https://api.github.com/users/tiangolo/orgs","repos_url":"https://api.github.com/users/tiangolo/repos","events_url":"https://api.github.com/users/tiangolo/events{/privacy}","received_events_url":"https://api.github.com/users/tiangolo/received_events","type":"User","site_admin":false},"html_url":"https://github.com/tiangolo/pydantic","description":"Data validation using Python type hinting","fork":true,"url":"https://api.github.com/repos/tiangolo/pydantic","forks_url":"https://api.github.com/repos/tiangolo/pydantic/forks","keys_url":"https://api.github.com/repos/tiangolo/pydantic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tiangolo/pydantic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tiangolo/pydantic/teams","hooks_url":"https://api.github.com/repos/tiangolo/pydantic/hooks","issue_events_url":"https://api.github.com/repos/tiangolo/pydantic/issues/events{/number}","events_url":"https://api.github.com/repos/tiangolo/pydantic/events","assignees_url":"https://api.github.com/repos/tiangolo/pydantic/assignees{/user}","branches_url":"https://api.github.com/repos/tiangolo/pydantic/branches{/branch}","tags_url":"https://api.github.com/repos/tiangolo/pydantic/tags","blobs_url":"https://api.github.com/repos/tiangolo/pydantic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tiangolo/pydantic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tiangolo/pydantic/git/refs{/sha}","trees_url":"https://api.github.com/repos/tiangolo/pydantic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tiangolo/pydantic/statuses/{sha}","languages_url":"https://api.github.com/repos/tiangolo/pydantic/languages","stargazers_url":"https://api.github.com/repos/tiangolo/pydantic/stargazers","contributors_url":"https://api.github.com/repos/tiangolo/pydantic/contributors","subscribers_url":"https://api.github.com/repos/tiangolo/pydantic/subscribers","subscription_url":"https://api.github.com/repos/tiangolo/pydantic/subscription","commits_url":"https://api.github.com/repos/tiangolo/pydantic/commits{/sha}","git_commits_url":"https://api.github.com/repos/tiangolo/pydantic/git/commits{/sha}","comments_url":"https://api.github.com/repos/tiangolo/pydantic/comments{/number}","issue_comment_url":"https://api.github.com/repos/tiangolo/pydantic/issues/comments{/number}","contents_url":"https://api.github.com/repos/tiangolo/pydantic/contents/{+path}","compare_url":"https://api.github.com/repos/tiangolo/pydantic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tiangolo/pydantic/merges","archive_url":"https://api.github.com/repos/tiangolo/pydantic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tiangolo/pydantic/downloads","issues_url":"https://api.github.com/repos/tiangolo/pydantic/issues{/number}","pulls_url":"https://api.github.com/repos/tiangolo/pydantic/pulls{/number}","milestones_url":"https://api.github.com/repos/tiangolo/pydantic/milestones{/number}","notifications_url":"https://api.github.com/repos/tiangolo/pydantic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tiangolo/pydantic/labels{/name}","releases_url":"https://api.github.com/repos/tiangolo/pydantic/releases{/id}","deployments_url":"https://api.github.com/repos/tiangolo/pydantic/deployments","created_at":"2018-10-21T04:21:54Z","updated_at":"2018-10-21T04:21:56Z","pushed_at":"2018-11-18T15:28:53Z","git_url":"git://github.com/tiangolo/pydantic.git","ssh_url":"git@github.com:tiangolo/pydantic.git","clone_url":"https://github.com/tiangolo/pydantic.git","svn_url":"https://github.com/tiangolo/pydantic","homepage":"https://pydantic-docs.helpmanual.io/","size":540,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"samuelcolvin:master","ref":"master","sha":"31a0c2b1a9eaee247bb8d17a95334baa80bbd2d5","user":{"login":"samuelcolvin","id":4039449,"node_id":"MDQ6VXNlcjQwMzk0NDk=","avatar_url":"https://avatars3.githubusercontent.com/u/4039449?v=4","gravatar_id":"","url":"https://api.github.com/users/samuelcolvin","html_url":"https://github.com/samuelcolvin","followers_url":"https://api.github.com/users/samuelcolvin/followers","following_url":"https://api.github.com/users/samuelcolvin/following{/other_user}","gists_url":"https://api.github.com/users/samuelcolvin/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelcolvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelcolvin/subscriptions","organizations_url":"https://api.github.com/users/samuelcolvin/orgs","repos_url":"https://api.github.com/users/samuelcolvin/repos","events_url":"https://api.github.com/users/samuelcolvin/events{/privacy}","received_events_url":"https://api.github.com/users/samuelcolvin/received_events","type":"User","site_admin":false},"repo":{"id":90194616,"node_id":"MDEwOlJlcG9zaXRvcnk5MDE5NDYxNg==","name":"pydantic","full_name":"samuelcolvin/pydantic","private":false,"owner":{"login":"samuelcolvin","id":4039449,"node_id":"MDQ6VXNlcjQwMzk0NDk=","avatar_url":"https://avatars3.githubusercontent.com/u/4039449?v=4","gravatar_id":"","url":"https://api.github.com/users/samuelcolvin","html_url":"https://github.com/samuelcolvin","followers_url":"https://api.github.com/users/samuelcolvin/followers","following_url":"https://api.github.com/users/samuelcolvin/following{/other_user}","gists_url":"https://api.github.com/users/samuelcolvin/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelcolvin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelcolvin/subscriptions","organizations_url":"https://api.github.com/users/samuelcolvin/orgs","repos_url":"https://api.github.com/users/samuelcolvin/repos","events_url":"https://api.github.com/users/samuelcolvin/events{/privacy}","received_events_url":"https://api.github.com/users/samuelcolvin/received_events","type":"User","site_admin":false},"html_url":"https://github.com/samuelcolvin/pydantic","description":"Data validation using Python type hinting","fork":false,"url":"https://api.github.com/repos/samuelcolvin/pydantic","forks_url":"https://api.github.com/repos/samuelcolvin/pydantic/forks","keys_url":"https://api.github.com/repos/samuelcolvin/pydantic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samuelcolvin/pydantic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samuelcolvin/pydantic/teams","hooks_url":"https://api.github.com/repos/samuelcolvin/pydantic/hooks","issue_events_url":"https://api.github.com/repos/samuelcolvin/pydantic/issues/events{/number}","events_url":"https://api.github.com/repos/samuelcolvin/pydantic/events","assignees_url":"https://api.github.com/repos/samuelcolvin/pydantic/assignees{/user}","branches_url":"https://api.github.com/repos/samuelcolvin/pydantic/branches{/branch}","tags_url":"https://api.github.com/repos/samuelcolvin/pydantic/tags","blobs_url":"https://api.github.com/repos/samuelcolvin/pydantic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samuelcolvin/pydantic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samuelcolvin/pydantic/git/refs{/sha}","trees_url":"https://api.github.com/repos/samuelcolvin/pydantic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samuelcolvin/pydantic/statuses/{sha}","languages_url":"https://api.github.com/repos/samuelcolvin/pydantic/languages","stargazers_url":"https://api.github.com/repos/samuelcolvin/pydantic/stargazers","contributors_url":"https://api.github.com/repos/samuelcolvin/pydantic/contributors","subscribers_url":"https://api.github.com/repos/samuelcolvin/pydantic/subscribers","subscription_url":"https://api.github.com/repos/samuelcolvin/pydantic/subscription","commits_url":"https://api.github.com/repos/samuelcolvin/pydantic/commits{/sha}","git_commits_url":"https://api.github.com/repos/samuelcolvin/pydantic/git/commits{/sha}","comments_url":"https://api.github.com/repos/samuelcolvin/pydantic/comments{/number}","issue_comment_url":"https://api.github.com/repos/samuelcolvin/pydantic/issues/comments{/number}","contents_url":"https://api.github.com/repos/samuelcolvin/pydantic/contents/{+path}","compare_url":"https://api.github.com/repos/samuelcolvin/pydantic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samuelcolvin/pydantic/merges","archive_url":"https://api.github.com/repos/samuelcolvin/pydantic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samuelcolvin/pydantic/downloads","issues_url":"https://api.github.com/repos/samuelcolvin/pydantic/issues{/number}","pulls_url":"https://api.github.com/repos/samuelcolvin/pydantic/pulls{/number}","milestones_url":"https://api.github.com/repos/samuelcolvin/pydantic/milestones{/number}","notifications_url":"https://api.github.com/repos/samuelcolvin/pydantic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samuelcolvin/pydantic/labels{/name}","releases_url":"https://api.github.com/repos/samuelcolvin/pydantic/releases{/id}","deployments_url":"https://api.github.com/repos/samuelcolvin/pydantic/deployments","created_at":"2017-05-03T21:23:58Z","updated_at":"2018-11-18T12:07:28Z","pushed_at":"2018-11-18T15:28:54Z","git_url":"git://github.com/samuelcolvin/pydantic.git","ssh_url":"git@github.com:samuelcolvin/pydantic.git","clone_url":"https://github.com/samuelcolvin/pydantic.git","svn_url":"https://github.com/samuelcolvin/pydantic","homepage":"https://pydantic-docs.helpmanual.io/","size":559,"stargazers_count":465,"watchers_count":465,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":42,"mirror_url":null,"archived":false,"open_issues_count":29,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":42,"open_issues":29,"watchers":465,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/308"},"html":{"href":"https://github.com/samuelcolvin/pydantic/pull/308"},"issue":{"href":"https://api.github.com/repos/samuelcolvin/pydantic/issues/308"},"comments":{"href":"https://api.github.com/repos/samuelcolvin/pydantic/issues/308/comments"},"review_comments":{"href":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/308/comments"},"review_comment":{"href":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/samuelcolvin/pydantic/pulls/308/commits"},"statuses":{"href":"https://api.github.com/repos/samuelcolvin/pydantic/statuses/5c0f21da183bbfa45bdf41c50dd288ccf6dd0bd7"}},"author_association":"NONE"}}
{"actor":{"display_login":"samuelcolvin"}}