{"action":"created","issue":{"url":"https://api.github.com/repos/encode/django-rest-framework/issues/5020","repository_url":"https://api.github.com/repos/encode/django-rest-framework","labels_url":"https://api.github.com/repos/encode/django-rest-framework/issues/5020/labels{/name}","comments_url":"https://api.github.com/repos/encode/django-rest-framework/issues/5020/comments","events_url":"https://api.github.com/repos/encode/django-rest-framework/issues/5020/events","html_url":"https://github.com/encode/django-rest-framework/pull/5020","id":216684591,"number":5020,"title":"#5002, #5003 Replace subpath with overall path in schema","user":{"login":"COCOLMAN","id":22088047,"avatar_url":"https://avatars2.githubusercontent.com/u/22088047?v=3","gravatar_id":"","url":"https://api.github.com/users/COCOLMAN","html_url":"https://github.com/COCOLMAN","followers_url":"https://api.github.com/users/COCOLMAN/followers","following_url":"https://api.github.com/users/COCOLMAN/following{/other_user}","gists_url":"https://api.github.com/users/COCOLMAN/gists{/gist_id}","starred_url":"https://api.github.com/users/COCOLMAN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/COCOLMAN/subscriptions","organizations_url":"https://api.github.com/users/COCOLMAN/orgs","repos_url":"https://api.github.com/users/COCOLMAN/repos","events_url":"https://api.github.com/users/COCOLMAN/events{/privacy}","received_events_url":"https://api.github.com/users/COCOLMAN/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-03-24T07:40:37Z","updated_at":"2017-04-03T09:49:50Z","closed_at":"2017-03-31T13:49:05Z","pull_request":{"url":"https://api.github.com/repos/encode/django-rest-framework/pulls/5020","html_url":"https://github.com/encode/django-rest-framework/pull/5020","diff_url":"https://github.com/encode/django-rest-framework/pull/5020.diff","patch_url":"https://github.com/encode/django-rest-framework/pull/5020.patch"},"body":"I've tried several ways to solve the subpath problem.\r\n\r\nI think it is most appropriate to delete the  subpath.\r\n\r\nIn addition, I added a filter to decorate.\r\n\r\nAs mentioned in '# 5002'\r\nI intended to expose more explicit names to the browser.\r\n\r\nI used overall instead of subpath.\r\noverall includes all paths.\r\nFor example\r\n`First/second/third /` is converted to `first-second-third`.\r\n\r\nThe browser now displays more clear sentences at the top.\r\n(I used a new filter to remove the '-' and changed it to uppercase.)\r\n![2017-03-23 17 03 22](https://cloud.githubusercontent.com/assets/22088047/24284437/96df8138-10ae-11e7-92ac-7e954b27fd22.png)\r\n![2017-03-23 17 03 47](https://cloud.githubusercontent.com/assets/22088047/24284441/9b7bbc98-10ae-11e7-869f-ad04f81ff2c6.png)\r\n\r\nI expect to force users to design url more readable.\r\n\r\n\r\nMore details\r\n\r\nIn the process of solving the problem,\r\nThere are additional modifications.\r\n\r\nIf `/some/` in a url such as` example/{pk}/some` is appropriate to be included as a sub-property of `/example/` if `/some/` is a` custom action`.\r\n\r\n\r\nHowever, if `/some/` is a method that is not a `custom action`(Having different 'actions'), I do not think it is appropriate to include it as a subproperty in `/example/`.\r\n\r\nSo in this case, instead of being a sub-property of `example`, it has a new overall of` example-some`.\r\n\r\nMy opinion is too much.\r\nI am afraid that this is against the overall design.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/encode/django-rest-framework/issues/comments/291097494","html_url":"https://github.com/encode/django-rest-framework/pull/5020#issuecomment-291097494","issue_url":"https://api.github.com/repos/encode/django-rest-framework/issues/5020","id":291097494,"user":{"login":"COCOLMAN","id":22088047,"avatar_url":"https://avatars2.githubusercontent.com/u/22088047?v=3","gravatar_id":"","url":"https://api.github.com/users/COCOLMAN","html_url":"https://github.com/COCOLMAN","followers_url":"https://api.github.com/users/COCOLMAN/followers","following_url":"https://api.github.com/users/COCOLMAN/following{/other_user}","gists_url":"https://api.github.com/users/COCOLMAN/gists{/gist_id}","starred_url":"https://api.github.com/users/COCOLMAN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/COCOLMAN/subscriptions","organizations_url":"https://api.github.com/users/COCOLMAN/orgs","repos_url":"https://api.github.com/users/COCOLMAN/repos","events_url":"https://api.github.com/users/COCOLMAN/events{/privacy}","received_events_url":"https://api.github.com/users/COCOLMAN/received_events","type":"User","site_admin":false},"created_at":"2017-04-03T09:49:50Z","updated_at":"2017-04-03T09:49:50Z","body":"When url is a tree structure,\r\n```\r\n##example urls##\r\n\r\n# root/urls.py\r\nurlpatterns = [\r\n    url(r'^admin/', admin.site.urls),\r\n    url(r'^member/', include('member.urls')),\r\n    url(r'^blog/', include('post.urls')),\r\n    url(r'^docs/', include_docs_urls(title='My API TITLE'))\r\n]\r\n\r\n# post/urls.py\r\nurlpatterns = [\r\n    url('^post/$', views.PostListCreateView.as_view())\r\n]\r\n\r\n# member/urls.py\r\nurlpatterns = [\r\n    url(r'^signup/$', views.UserCreate.as_view()),\r\n    url(r'^myinfo/(?P<pk>[0-9]+)$', views.TestView.as_view())\r\n]\r\n```\r\n\r\nThe schema created dict that contains dict.\r\n\r\nIssue # 5003\r\nThis happens because there is no 'action' at the moment API Document expects to have an 'action' in the schema.\r\n\r\n\r\nThe schema for these URLs is:\r\n\r\n```\r\n<My API TITLE \"http://127.0.0.1:8000/docs/schema.js\">\r\n    blog: {\r\n        post: {\r\n            list()\r\n            create(title, author, [content])\r\n        }\r\n    }\r\n    member: {\r\n        myinfo: {\r\n            read(id)\r\n            update(id, name, password)\r\n            partial_update(id, [name], [password])\r\n        }\r\n        signup: {\r\n            create(name, password)\r\n        }\r\n    }\r\n```\r\n\r\n> Removing `include ('post.urls')` from `root / urls` works fine because all urls remove the common` member / `and the schema looks like this:\r\n```\r\n<My API TITLE \"http://127.0.0.1:8000/docs/schema.js\">\r\n    myinfo: {\r\n        read(id)\r\n        update(id, name, password)\r\n        partial_update(id, [name], [password])\r\n    }\r\n    signup: {\r\n        create(name, password)\r\n    }\r\n```\r\n\r\n\r\nIn order to make this schema work, I changed it as follows.\r\n\r\n```\r\n<My API TITLE \"http://127.0.0.1:8000/docs/schema.js\">\r\n    blog-post: {\r\n        list()\r\n        create(title, author, [content])\r\n    }\r\n\r\n    member-myinfo: {\r\n        read(id)\r\n        update(id, name, password)\r\n        partial_update(id, [name], [password])\r\n    }\r\n    member-signup: {\r\n        create(name, password)\r\n    }\r\n```\r\n\r\nI Include all url paths to avoid losing meaning.\r\n\r\nURLs are linked with '-' so you can use coreapi normally from the command line.\r\n\r\n\r\nThe above content is the key content I have used to solve this problem.\r\n\r\n\r\nThere are two additional changes in the above 'PR'.\r\n\r\n\r\n### 1\r\n```\r\nIn addition, I added a filter to decorate.\r\n...\r\n(I used a new filter to remove the '-' and changed it to uppercase.)\r\n```\r\n\r\n### 2\r\n```\r\nIf /some/ in a url such asexample/{pk}/some is appropriate to be included as a sub-property of /example/ if /some/ is acustom action.\r\n\r\nHowever, if /some/ is a method that is not a custom action(Having different 'actions'), I do not think it is appropriate to include it as a subproperty in /example/.\r\n\r\nSo in this case, instead of being a sub-property of example, it has a new overall ofexample-some.\r\n```\r\n\r\nI want feedback.\r\n"}}
{"actor":{"display_login":"COCOLMAN"}}