{"action":"created","comment":{"url":"https://api.github.com/repos/stablekernel/aqueduct/pulls/comments/73412155","id":73412155,"diff_hunk":"@@ -1,189 +1,419 @@\n part of aqueduct;\n \n-class APIHeader {\n+class APIDocumentable {\n+  APIDocumentable get documentableChild => null;\n+\n+  APIDocument documentAPI(PackagePathResolver resolver) => documentableChild?.documentAPI(resolver);\n+  List<APIPath> documentPaths(PackagePathResolver resolver) => documentableChild?.documentPaths(resolver);\n+  List<APIOperation> documentOperations(PackagePathResolver resolver) => documentableChild?.documentOperations(resolver);\n+  Map<String, APISecurityScheme> documentSecuritySchemes(PackagePathResolver resolver) => documentableChild?.documentSecuritySchemes(resolver);\n+}\n+\n+class APIDocument {\n+  APIInfo info = new APIInfo();\n+  List<APIHost> hosts = [];\n+  List<ContentType> consumes = [];\n+  List<ContentType> produces = [];\n+  List<APIPath> paths = [];\n+  List<APISecurityRequirement> securityRequirements = [];\n+  Map<String, APISecurityScheme> securitySchemes = {};\n+\n+  Map<String, dynamic> asMap() {\n+    var m = {};\n+\n+    m[\"openapi\"] = \"3.0.*\";\n+    m[\"info\"] = info.asMap();\n+    m[\"hosts\"] = hosts;\n+    m[\"consumes\"] = consumes.map((ct) => ct.toString()).toList();\n+    m[\"produces\"] = produces.map((ct) => ct.toString()).toList();\n+    m[\"security\"] = securityRequirements.map((sec) => sec.name).toList();\n+    m[\"paths\"] = new Map.fromIterable(paths, key: (APIPath k) => k.path, value: (APIPath v) => v.asMap());\n+\n+    var mappedSchemes = {};\n+    securitySchemes?.forEach((k, scheme) {\n+      mappedSchemes[k] = scheme.asMap();\n+    });\n+    m[\"securityDefinitions\"] = mappedSchemes;\n+\n+    return m;\n+  }\n+}\n+\n+class APIInfo {\n   String title = \"API\";\n   String description = \"Description\";\n   String version = \"1.0\";\n+  String termsOfServiceURL = \"\";\n+  APIContact contact;\n+  APILicense license;\n \n   Map<String, String> asMap() {\n     return {\n       \"title\" : title,\n       \"description\" : description,\n-      \"version\" : version\n+      \"version\" : version,\n+      \"termsOfService\" : termsOfServiceURL,\n+      \"contact\" : contact?.asMap(),\n+      \"license\" : license?.asMap()\n     };\n   }\n }\n \n-class APIDocument {\n-  APIHeader header = new APIHeader();\n-  List<APIDocumentItem> items = [];\n-  String host = \"localhost:8080\";\n-  List<String> schemes = [\"http\", \"https\"];\n-\n-  List<APISecurityItem> securityItems = [\n-    new APISecurityItem()\n-      ..name = \"client_auth\"\n-      ..description = \"Authorization: Basic base64({ClientID}:{ClientSecret})\"\n-      ..type = APISecurityType.basic,\n-    new APISecurityItem()\n-      ..name = \"token\"\n-      ..description = \"Authorization: Bearer {Token}\"\n-      ..type = APISecurityType.oauth2\n-      ..tokenURL = \"\"\n-      ..flow = \"password\"\n-  ];\n+class APIContact {\n+  String name;\n+  String url;\n+  String email;\n \n-  Map<String, dynamic> asMap() {\n-    var m = {};\n+  Map<String, String> asMap() {\n+    return {\n+      \"name\" : name,\n+      \"url\" : url,\n+      \"email\" : email\n+    };\n+  }\n+}\n \n-    m[\"swagger\"] = \"2.0\";\n-    m[\"info\"] = header.asMap();\n-    m[\"host\"] = host;\n-    m[\"schemes\"] = schemes;\n-\n-    if (securityItems != null) {\n-      var sec = {};\n-      securityItems.forEach((si) {\n-        sec[si.name] = si.asMap();\n-      });\n-      m[\"securityDefinitions\"] = sec;\n-    }\n+class APILicense {\n+  String name;\n+  String URL;","path":"lib/base/documentable.dart","position":112,"original_position":112,"commit_id":"49f5ba1b2762a10943e6bce7a21d704a5ed44c9c","original_commit_id":"49f5ba1b2762a10943e6bce7a21d704a5ed44c9c","user":{"login":"smswz","id":588960,"avatar_url":"https://avatars.githubusercontent.com/u/588960?v=3","gravatar_id":"","url":"https://api.github.com/users/smswz","html_url":"https://github.com/smswz","followers_url":"https://api.github.com/users/smswz/followers","following_url":"https://api.github.com/users/smswz/following{/other_user}","gists_url":"https://api.github.com/users/smswz/gists{/gist_id}","starred_url":"https://api.github.com/users/smswz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smswz/subscriptions","organizations_url":"https://api.github.com/users/smswz/orgs","repos_url":"https://api.github.com/users/smswz/repos","events_url":"https://api.github.com/users/smswz/events{/privacy}","received_events_url":"https://api.github.com/users/smswz/received_events","type":"User","site_admin":false},"body":"lowercase URL","created_at":"2016-08-03T20:17:05Z","updated_at":"2016-08-03T20:17:05Z","html_url":"https://github.com/stablekernel/aqueduct/pull/69#discussion_r73412155","pull_request_url":"https://api.github.com/repos/stablekernel/aqueduct/pulls/69","_links":{"self":{"href":"https://api.github.com/repos/stablekernel/aqueduct/pulls/comments/73412155"},"html":{"href":"https://github.com/stablekernel/aqueduct/pull/69#discussion_r73412155"},"pull_request":{"href":"https://api.github.com/repos/stablekernel/aqueduct/pulls/69"}}},"pull_request":{"url":"https://api.github.com/repos/stablekernel/aqueduct/pulls/69","id":76503834,"html_url":"https://github.com/stablekernel/aqueduct/pull/69","diff_url":"https://github.com/stablekernel/aqueduct/pull/69.diff","patch_url":"https://github.com/stablekernel/aqueduct/pull/69.patch","issue_url":"https://api.github.com/repos/stablekernel/aqueduct/issues/69","number":69,"state":"open","locked":false,"title":"Jc/openapi3","user":{"login":"joeconwaystk","id":1576234,"avatar_url":"https://avatars.githubusercontent.com/u/1576234?v=3","gravatar_id":"","url":"https://api.github.com/users/joeconwaystk","html_url":"https://github.com/joeconwaystk","followers_url":"https://api.github.com/users/joeconwaystk/followers","following_url":"https://api.github.com/users/joeconwaystk/following{/other_user}","gists_url":"https://api.github.com/users/joeconwaystk/gists{/gist_id}","starred_url":"https://api.github.com/users/joeconwaystk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joeconwaystk/subscriptions","organizations_url":"https://api.github.com/users/joeconwaystk/orgs","repos_url":"https://api.github.com/users/joeconwaystk/repos","events_url":"https://api.github.com/users/joeconwaystk/events{/privacy}","received_events_url":"https://api.github.com/users/joeconwaystk/received_events","type":"User","site_admin":false},"body":"This PR accomplishes two things:\r\n\r\n1. Significantly improves the router's capabilities and performance by using a tree search instead of just iterating over routes. This also helps recognize route collisions prior to starting the server, which will now reveal themselves at startup.\r\n\r\n2. Introduces a much improved documentation generating scheme for the OpenAPI 3.0 specification. While not fully complete, the structure is there and the majority of the items in the specification are automatically generated. There are a handful of issues in pivotal for fully completing this implementation, but do require some improvements to the auth implementation first.","created_at":"2016-07-06T21:19:44Z","updated_at":"2016-08-03T20:17:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2d83af72c1a0645e32e475e437a2dc0b6c58b27","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/stablekernel/aqueduct/pulls/69/commits","review_comments_url":"https://api.github.com/repos/stablekernel/aqueduct/pulls/69/comments","review_comment_url":"https://api.github.com/repos/stablekernel/aqueduct/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stablekernel/aqueduct/issues/69/comments","statuses_url":"https://api.github.com/repos/stablekernel/aqueduct/statuses/49f5ba1b2762a10943e6bce7a21d704a5ed44c9c","head":{"label":"stablekernel:jc/openapi3","ref":"jc/openapi3","sha":"49f5ba1b2762a10943e6bce7a21d704a5ed44c9c","user":{"login":"stablekernel","id":4998931,"avatar_url":"https://avatars.githubusercontent.com/u/4998931?v=3","gravatar_id":"","url":"https://api.github.com/users/stablekernel","html_url":"https://github.com/stablekernel","followers_url":"https://api.github.com/users/stablekernel/followers","following_url":"https://api.github.com/users/stablekernel/following{/other_user}","gists_url":"https://api.github.com/users/stablekernel/gists{/gist_id}","starred_url":"https://api.github.com/users/stablekernel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stablekernel/subscriptions","organizations_url":"https://api.github.com/users/stablekernel/orgs","repos_url":"https://api.github.com/users/stablekernel/repos","events_url":"https://api.github.com/users/stablekernel/events{/privacy}","received_events_url":"https://api.github.com/users/stablekernel/received_events","type":"Organization","site_admin":false},"repo":{"id":36523292,"name":"aqueduct","full_name":"stablekernel/aqueduct","owner":{"login":"stablekernel","id":4998931,"avatar_url":"https://avatars.githubusercontent.com/u/4998931?v=3","gravatar_id":"","url":"https://api.github.com/users/stablekernel","html_url":"https://github.com/stablekernel","followers_url":"https://api.github.com/users/stablekernel/followers","following_url":"https://api.github.com/users/stablekernel/following{/other_user}","gists_url":"https://api.github.com/users/stablekernel/gists{/gist_id}","starred_url":"https://api.github.com/users/stablekernel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stablekernel/subscriptions","organizations_url":"https://api.github.com/users/stablekernel/orgs","repos_url":"https://api.github.com/users/stablekernel/repos","events_url":"https://api.github.com/users/stablekernel/events{/privacy}","received_events_url":"https://api.github.com/users/stablekernel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stablekernel/aqueduct","description":"Web server convenience utilities for dart","fork":false,"url":"https://api.github.com/repos/stablekernel/aqueduct","forks_url":"https://api.github.com/repos/stablekernel/aqueduct/forks","keys_url":"https://api.github.com/repos/stablekernel/aqueduct/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stablekernel/aqueduct/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stablekernel/aqueduct/teams","hooks_url":"https://api.github.com/repos/stablekernel/aqueduct/hooks","issue_events_url":"https://api.github.com/repos/stablekernel/aqueduct/issues/events{/number}","events_url":"https://api.github.com/repos/stablekernel/aqueduct/events","assignees_url":"https://api.github.com/repos/stablekernel/aqueduct/assignees{/user}","branches_url":"https://api.github.com/repos/stablekernel/aqueduct/branches{/branch}","tags_url":"https://api.github.com/repos/stablekernel/aqueduct/tags","blobs_url":"https://api.github.com/repos/stablekernel/aqueduct/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stablekernel/aqueduct/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stablekernel/aqueduct/git/refs{/sha}","trees_url":"https://api.github.com/repos/stablekernel/aqueduct/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stablekernel/aqueduct/statuses/{sha}","languages_url":"https://api.github.com/repos/stablekernel/aqueduct/languages","stargazers_url":"https://api.github.com/repos/stablekernel/aqueduct/stargazers","contributors_url":"https://api.github.com/repos/stablekernel/aqueduct/contributors","subscribers_url":"https://api.github.com/repos/stablekernel/aqueduct/subscribers","subscription_url":"https://api.github.com/repos/stablekernel/aqueduct/subscription","commits_url":"https://api.github.com/repos/stablekernel/aqueduct/commits{/sha}","git_commits_url":"https://api.github.com/repos/stablekernel/aqueduct/git/commits{/sha}","comments_url":"https://api.github.com/repos/stablekernel/aqueduct/comments{/number}","issue_comment_url":"https://api.github.com/repos/stablekernel/aqueduct/issues/comments{/number}","contents_url":"https://api.github.com/repos/stablekernel/aqueduct/contents/{+path}","compare_url":"https://api.github.com/repos/stablekernel/aqueduct/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stablekernel/aqueduct/merges","archive_url":"https://api.github.com/repos/stablekernel/aqueduct/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stablekernel/aqueduct/downloads","issues_url":"https://api.github.com/repos/stablekernel/aqueduct/issues{/number}","pulls_url":"https://api.github.com/repos/stablekernel/aqueduct/pulls{/number}","milestones_url":"https://api.github.com/repos/stablekernel/aqueduct/milestones{/number}","notifications_url":"https://api.github.com/repos/stablekernel/aqueduct/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stablekernel/aqueduct/labels{/name}","releases_url":"https://api.github.com/repos/stablekernel/aqueduct/releases{/id}","deployments_url":"https://api.github.com/repos/stablekernel/aqueduct/deployments","created_at":"2015-05-29T18:56:06Z","updated_at":"2016-07-16T19:36:14Z","pushed_at":"2016-08-03T20:16:24Z","git_url":"git://github.com/stablekernel/aqueduct.git","ssh_url":"git@github.com:stablekernel/aqueduct.git","clone_url":"https://github.com/stablekernel/aqueduct.git","svn_url":"https://github.com/stablekernel/aqueduct","homepage":null,"size":2422,"stargazers_count":5,"watchers_count":5,"language":"Dart","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":5,"default_branch":"master"}},"base":{"label":"stablekernel:master","ref":"master","sha":"bafe1e55d1b497080dad63665002a58d894b9b60","user":{"login":"stablekernel","id":4998931,"avatar_url":"https://avatars.githubusercontent.com/u/4998931?v=3","gravatar_id":"","url":"https://api.github.com/users/stablekernel","html_url":"https://github.com/stablekernel","followers_url":"https://api.github.com/users/stablekernel/followers","following_url":"https://api.github.com/users/stablekernel/following{/other_user}","gists_url":"https://api.github.com/users/stablekernel/gists{/gist_id}","starred_url":"https://api.github.com/users/stablekernel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stablekernel/subscriptions","organizations_url":"https://api.github.com/users/stablekernel/orgs","repos_url":"https://api.github.com/users/stablekernel/repos","events_url":"https://api.github.com/users/stablekernel/events{/privacy}","received_events_url":"https://api.github.com/users/stablekernel/received_events","type":"Organization","site_admin":false},"repo":{"id":36523292,"name":"aqueduct","full_name":"stablekernel/aqueduct","owner":{"login":"stablekernel","id":4998931,"avatar_url":"https://avatars.githubusercontent.com/u/4998931?v=3","gravatar_id":"","url":"https://api.github.com/users/stablekernel","html_url":"https://github.com/stablekernel","followers_url":"https://api.github.com/users/stablekernel/followers","following_url":"https://api.github.com/users/stablekernel/following{/other_user}","gists_url":"https://api.github.com/users/stablekernel/gists{/gist_id}","starred_url":"https://api.github.com/users/stablekernel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stablekernel/subscriptions","organizations_url":"https://api.github.com/users/stablekernel/orgs","repos_url":"https://api.github.com/users/stablekernel/repos","events_url":"https://api.github.com/users/stablekernel/events{/privacy}","received_events_url":"https://api.github.com/users/stablekernel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stablekernel/aqueduct","description":"Web server convenience utilities for dart","fork":false,"url":"https://api.github.com/repos/stablekernel/aqueduct","forks_url":"https://api.github.com/repos/stablekernel/aqueduct/forks","keys_url":"https://api.github.com/repos/stablekernel/aqueduct/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stablekernel/aqueduct/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stablekernel/aqueduct/teams","hooks_url":"https://api.github.com/repos/stablekernel/aqueduct/hooks","issue_events_url":"https://api.github.com/repos/stablekernel/aqueduct/issues/events{/number}","events_url":"https://api.github.com/repos/stablekernel/aqueduct/events","assignees_url":"https://api.github.com/repos/stablekernel/aqueduct/assignees{/user}","branches_url":"https://api.github.com/repos/stablekernel/aqueduct/branches{/branch}","tags_url":"https://api.github.com/repos/stablekernel/aqueduct/tags","blobs_url":"https://api.github.com/repos/stablekernel/aqueduct/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stablekernel/aqueduct/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stablekernel/aqueduct/git/refs{/sha}","trees_url":"https://api.github.com/repos/stablekernel/aqueduct/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stablekernel/aqueduct/statuses/{sha}","languages_url":"https://api.github.com/repos/stablekernel/aqueduct/languages","stargazers_url":"https://api.github.com/repos/stablekernel/aqueduct/stargazers","contributors_url":"https://api.github.com/repos/stablekernel/aqueduct/contributors","subscribers_url":"https://api.github.com/repos/stablekernel/aqueduct/subscribers","subscription_url":"https://api.github.com/repos/stablekernel/aqueduct/subscription","commits_url":"https://api.github.com/repos/stablekernel/aqueduct/commits{/sha}","git_commits_url":"https://api.github.com/repos/stablekernel/aqueduct/git/commits{/sha}","comments_url":"https://api.github.com/repos/stablekernel/aqueduct/comments{/number}","issue_comment_url":"https://api.github.com/repos/stablekernel/aqueduct/issues/comments{/number}","contents_url":"https://api.github.com/repos/stablekernel/aqueduct/contents/{+path}","compare_url":"https://api.github.com/repos/stablekernel/aqueduct/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stablekernel/aqueduct/merges","archive_url":"https://api.github.com/repos/stablekernel/aqueduct/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stablekernel/aqueduct/downloads","issues_url":"https://api.github.com/repos/stablekernel/aqueduct/issues{/number}","pulls_url":"https://api.github.com/repos/stablekernel/aqueduct/pulls{/number}","milestones_url":"https://api.github.com/repos/stablekernel/aqueduct/milestones{/number}","notifications_url":"https://api.github.com/repos/stablekernel/aqueduct/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stablekernel/aqueduct/labels{/name}","releases_url":"https://api.github.com/repos/stablekernel/aqueduct/releases{/id}","deployments_url":"https://api.github.com/repos/stablekernel/aqueduct/deployments","created_at":"2015-05-29T18:56:06Z","updated_at":"2016-07-16T19:36:14Z","pushed_at":"2016-08-03T20:16:24Z","git_url":"git://github.com/stablekernel/aqueduct.git","ssh_url":"git@github.com:stablekernel/aqueduct.git","clone_url":"https://github.com/stablekernel/aqueduct.git","svn_url":"https://github.com/stablekernel/aqueduct","homepage":null,"size":2422,"stargazers_count":5,"watchers_count":5,"language":"Dart","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":15,"forks":0,"open_issues":15,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stablekernel/aqueduct/pulls/69"},"html":{"href":"https://github.com/stablekernel/aqueduct/pull/69"},"issue":{"href":"https://api.github.com/repos/stablekernel/aqueduct/issues/69"},"comments":{"href":"https://api.github.com/repos/stablekernel/aqueduct/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/stablekernel/aqueduct/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/stablekernel/aqueduct/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stablekernel/aqueduct/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/stablekernel/aqueduct/statuses/49f5ba1b2762a10943e6bce7a21d704a5ed44c9c"}}}}
{"actor":{"display_login":"smswz"}}