{"action":"created","issue":{"url":"https://api.github.com/repos/metosin/compojure-api/issues/242","repository_url":"https://api.github.com/repos/metosin/compojure-api","labels_url":"https://api.github.com/repos/metosin/compojure-api/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/metosin/compojure-api/issues/242/comments","events_url":"https://api.github.com/repos/metosin/compojure-api/issues/242/events","html_url":"https://github.com/metosin/compojure-api/pull/242","id":164956163,"number":242,"title":"Add option to look at the user'a handler before swagger-ui handler","user":{"login":"amalloy","id":368685,"avatar_url":"https://avatars.githubusercontent.com/u/368685?v=3","gravatar_id":"","url":"https://api.github.com/users/amalloy","html_url":"https://github.com/amalloy","followers_url":"https://api.github.com/users/amalloy/followers","following_url":"https://api.github.com/users/amalloy/following{/other_user}","gists_url":"https://api.github.com/users/amalloy/gists{/gist_id}","starred_url":"https://api.github.com/users/amalloy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amalloy/subscriptions","organizations_url":"https://api.github.com/users/amalloy/orgs","repos_url":"https://api.github.com/users/amalloy/repos","events_url":"https://api.github.com/users/amalloy/events{/privacy}","received_events_url":"https://api.github.com/users/amalloy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-11T22:42:17Z","updated_at":"2016-07-13T18:29:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/metosin/compojure-api/pulls/242","html_url":"https://github.com/metosin/compojure-api/pull/242","diff_url":"https://github.com/metosin/compojure-api/pull/242.diff","patch_url":"https://github.com/metosin/compojure-api/pull/242.patch"},"body":"The docs I added may be a bit too verbose - I wasn't sure how much \"justification\" of the feature belongs in the docstring vs in this pull request. Basically the idea is that it's ideal to consult the user's handler before consulting the swagger-ui handler, so that the user sees no performance penalty on performance-sensitive requests. But normally you can't do that, because the user's handler will return a 404 for routes it doesn't recognize, including swagger-ui routes.\r\n\r\nSo, I added a way to specifically say \"my handler won't return a 404 for routes it doesn't recognize\", meaning that it becomes safe to consult the user's handler first, then the swagger-ui routes, and then if *neither* of those matches, presume that the user has wrapped the entire `(api ...)` handler in some middleware that will produce 404 responses as necessary.\r\n\r\nAn alternative implementation that could resolve the issue differently would be to add a `not-found-handler` option to `api`, and insert that after both the user's handler and the swagger-ui handler. You still need to be sure that the user's handler doesn't return any 404s it shouldn't, but perhaps this is a more self-documenting way to explain how 404s will be handled."},"comment":{"url":"https://api.github.com/repos/metosin/compojure-api/issues/comments/232445249","html_url":"https://github.com/metosin/compojure-api/pull/242#issuecomment-232445249","issue_url":"https://api.github.com/repos/metosin/compojure-api/issues/242","id":232445249,"user":{"login":"amalloy","id":368685,"avatar_url":"https://avatars.githubusercontent.com/u/368685?v=3","gravatar_id":"","url":"https://api.github.com/users/amalloy","html_url":"https://github.com/amalloy","followers_url":"https://api.github.com/users/amalloy/followers","following_url":"https://api.github.com/users/amalloy/following{/other_user}","gists_url":"https://api.github.com/users/amalloy/gists{/gist_id}","starred_url":"https://api.github.com/users/amalloy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amalloy/subscriptions","organizations_url":"https://api.github.com/users/amalloy/orgs","repos_url":"https://api.github.com/users/amalloy/repos","events_url":"https://api.github.com/users/amalloy/events{/privacy}","received_events_url":"https://api.github.com/users/amalloy/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T18:29:45Z","updated_at":"2016-07-13T18:29:45Z","body":"Oh right. There's a middleware that wraps the swagger info collected from the various GETs, so that `/swagger.json` can look that up. Got it."}}
{"actor":{"display_login":"amalloy"}}