{"action":"created","issue":{"url":"https://api.github.com/repos/akka/akka-http/issues/218","repository_url":"https://api.github.com/repos/akka/akka-http","labels_url":"https://api.github.com/repos/akka/akka-http/issues/218/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka-http/issues/218/comments","events_url":"https://api.github.com/repos/akka/akka-http/issues/218/events","html_url":"https://github.com/akka/akka-http/issues/218","id":175966734,"number":218,"title":"Great getting started ticket: write example snippets for Akka HTTP Java DSL","user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/akka/akka-http/milestones/3","html_url":"https://github.com/akka/akka-http/milestones/2.4.11","labels_url":"https://api.github.com/repos/akka/akka-http/milestones/3/labels","id":1990819,"number":3,"title":"2.4.11","description":"","creator":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":4,"state":"open","created_at":"2016-09-08T10:08:45Z","updated_at":"2016-09-09T09:29:35Z","due_on":null,"closed_at":null},"comments":20,"created_at":"2016-09-09T09:29:34Z","updated_at":"2016-09-09T09:30:04Z","closed_at":null,"body":"<a href=\"https://github.com/johanandren\"><img src=\"https://avatars.githubusercontent.com/u/666915?v=3\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [johanandren](https://github.com/johanandren)**\n_Friday May 06, 2016 at 14:06 GMT_\n_Originally opened as https://github.com/akka/akka/issues/20466_\n\n----\n\nThe last couple of months we have been hard at work with providing a DSL for Java that is (almost) as neat as the Scala DSL for Akka HTTP. We are now at the point where we have the API in place in master and basic docs but what is missing is examples for each of the directives. \r\n\r\nProviding an example for a directive is a perfect way to start contributing to Akka, each directive is sufficiently isolated, and there is a corresponding Scala example to base the sample on.\r\n\r\nHow to do it:\r\n* **Select a directive below**, **write a comment** that you will be working on it\r\n* **Read the docs**, [the corresponding Scala directive docs]file(http://doc.akka.io/docs/akka/2.4.4/scala/http/routing-dsl/directives/alphabetically.html#predefined-directives) and make sure you understand what the directive does\r\n* Look at **the Scala example** in `akka-docs/rst/scala/code/docs/http/scaladsl/server/directives` and port it to a Java example in `akka-docs/rst/java/code/docs/http/javadsl/server/directives`. Look at the existing Java samples to see how the tests should be set up\r\n* **Run the test using** `akka-docs/testOnly docs.http.javadsl.server.directives.YourDirective`\r\n* **Include the test in the docs** by adding comments with the label from the `.rst` documentation of the directive. \r\n* **Generate the docs** using `akka-docs/sphinx:generateHtml` and see that the sample is included in the docs and looks nice (you will find the docs generated as HTML under akka-docs/target/sphinx/html/index.html` so that you can preview in your browser)\r\n* **Make a PR** to have the sample reviewed and merged into Akka HTTP\r\n\r\n**Directives to provide samples for**\r\n(all paths relative to `akka-docs/rst/java/http/routing-dsl/directives`)\r\n- [x] basic-directives/cancelRejection.rst thanks @Hawstein!\r\n- [x] basic-directives/cancelRejections.rst thanks @Hawstein!\r\n- [x] basic-directives/extract.rst thanks @Hawstein!\r\n- [x] basic-directives/extractExecutionContext.rst thanks @Hawstein!\r\n- [x] basic-directives/extractLog.rst thanks @Hawstein!\r\n- [x] basic-directives/extractMaterializer.rst thanks @Hawstein!\r\n- [x] basic-directives/extractRequest.rst thanks @Hawstein!\r\n- [x] basic-directives/extractRequestContext.rst thanks @Hawstein!\r\n- [x] basic-directives/extractSettings.rst thanks @Hawstein!\r\n- [x] basic-directives/extractUnmatchedPath.rst thanks @Hawstein!\r\n- [x] basic-directives/extractUri.rst thanks @Hawstein!\r\n- [x] basic-directives/mapInnerRoute.rst thanks @Hawstein!\r\n- [x] basic-directives/mapRejections.rst thanks @Hawstein!\r\n- [x] basic-directives/mapRequest.rst thanks @Hawstein!\r\n- [x] basic-directives/mapRequestContext.rst thanks @Hawstein!\r\n- [x] basic-directives/mapResponse.rst thanks @Hawstein!\r\n- [x] basic-directives/mapResponseEntity.rst thanks @Hawstein!\r\n- [x] basic-directives/mapResponseHeaders.rst thanks @Hawstein!\r\n- [x] basic-directives/mapRouteResult.rst thanks @Hawstein!\r\n- [x] basic-directives/mapRouteResultPF.rst thanks @Hawstein!\r\n- [x] basic-directives/mapRouteResultStage.rst thanks @Hawstein!\r\n- [x] basic-directives/mapRouteResultWith.rst thanks @Hawstein!\r\n- [x] basic-directives/mapRouteResultWithPF.rst thanks @Hawstein!\r\n- [x] basic-directives/mapSettings.rst thanks @Hawstein!\r\n- [x] basic-directives/mapUnmatchedPath.rst thanks @Hawstein!\r\n- [x] basic-directives/pass.rst thanks @Hawstein!\r\n- [x] basic-directives/provide.rst thanks @Hawstein!\r\n- [x] basic-directives/recoverRejections.rst thanks @Hawstein!\r\n- [x] basic-directives/recoverRejectionsWith.rst thanks @Hawstein!\r\n- [x] basic-directives/withExecutionContext.rst thanks @Hawstein!\r\n- [x] basic-directives/withLog.rst thanks @Hawstein!\r\n- [x] basic-directives/withMaterializer.rst thanks @Hawstein!\r\n- [x] basic-directives/withSettings.rst thanks @Hawstein!\r\n- [x] coding-directives/decodeRequest.rst thanks @Hawstein!\r\n- [x] coding-directives/decodeRequestWith.rst thanks @Hawstein!\r\n- [x] coding-directives/encodeResponse.rst thanks @Hawstein!\r\n- [x] coding-directives/encodeResponseWith.rst thanks @Hawstein!\r\n- [x] coding-directives/responseEncodingAccepted.rst thanks @Hawstein!\r\n- [x] cookie-directives/cookie.rst thanks @Hawstein!\r\n- [x] cookie-directives/deleteCookie.rst thanks @Hawstein!\r\n- [x] cookie-directives/optionalCookie.rst thanks @Hawstein!\r\n- [x] cookie-directives/setCookie.rst thanks @Hawstein!\r\n- [x] debugging-directives/logRequest.rst thanks @fagossa!\r\n- [x] debugging-directives/logRequestResult.rst thanks @fagossa!\r\n- [x] debugging-directives/logResult.rst thanks @fagossa!\r\n- [x] execution-directives/handleExceptions.rst thanks @Hawstein!\r\n- [x] execution-directives/handleRejections.rst thanks @Hawstein!\r\n- [x] file-and-resource-directives/getFromBrowseableDirectories.rst thanks @Hawstein! \r\n- [x] file-and-resource-directives/getFromBrowseableDirectory.rst thanks @Hawstein!\r\n- [x] file-and-resource-directives/getFromDirectory.rst thanks @Hawstein!\r\n- [x] file-and-resource-directives/getFromFile.rst thanks @Hawstein!\r\n- [x] file-and-resource-directives/getFromResource.rst thanks @Hawstein!\r\n- [x] file-and-resource-directives/getFromResourceDirectory.rst thanks @Hawstein!\r\n- [x] file-and-resource-directives/listDirectoryContents.rst thanks @Hawstein!\r\n- [x] file-upload-directives/fileUpload.rst thanks @gosubpl!\r\n- [x] file-upload-directives/uploadedFile.rst thanks @gosubpl!\r\n- [x] form-field-directives/formField.rst thanks @Hawstein!\r\n- [x] form-field-directives/formFieldList.rst thanks @Hawstein!\r\n- [x] form-field-directives/formFieldMap.rst thanks @Hawstein!\r\n- [x] form-field-directives/formFieldMultiMap.rst thanks @Hawstein!\r\n- [x] future-directives/completeOrRecoverWith.rst\r\n- [x] future-directives/onComplete.rst\r\n- [x] future-directives/onSuccess.rst\r\n- [x] header-directives/headerValue.rst thanks @zhxiaogg!\r\n- [x] header-directives/headerValueByName.rst thanks @zhxiaogg!\r\n- [x] header-directives/headerValueByType.rst thanks @zhxiaogg!\r\n- [x] header-directives/headerValuePF.rst thanks @zhxiaogg!\r\n- [x] header-directives/optionalHeaderValue.rst thanks @zhxiaogg!\r\n- [x] header-directives/optionalHeaderValueByName.rst thanks @zhxiaogg!\r\n- [x] header-directives/optionalHeaderValueByType.rst thanks @zhxiaogg!\r\n- [x] header-directives/optionalHeaderValuePF.rst thanks @zhxiaogg!\r\n- [ ] marshalling-directives/completeWith.rst\r\n- [ ] marshalling-directives/entity.rst\r\n- [ ] marshalling-directives/handleWith.rst\r\n- [ ] misc-directives/extractClientIP.rst\r\n- [ ] misc-directives/rejectEmptyResponse.rst\r\n- [ ] misc-directives/requestEntityEmpty.rst\r\n- [ ] misc-directives/requestEntityPresent.rst\r\n- [ ] misc-directives/selectPreferredLanguage.rst\r\n- [ ] misc-directives/validate.rst\r\n- [x] parameter-directives/parameter.rst thanks @Hawstein!\r\n- [x] parameter-directives/parameterMap.rst thanks @Hawstein!\r\n- [x] parameter-directives/parameterMultiMap.rst thanks @Hawstein!\r\n- [x] parameter-directives/parameters.rst thanks @Hawstein!\r\n- [x] parameter-directives/parameterSeq.rst thanks @Hawstein!\r\n- [x] path-directives/path.rst thanks @fagossa !\r\n- [x] path-directives/pathEnd.rst thanks @fagossa !\r\n- [x] path-directives/pathEndOrSingleSlash.rst thanks @fagossa !\r\n- [x] path-directives/pathPrefix.rst thanks @fagossa !\r\n- [x] path-directives/pathPrefixTest.rst thanks @fagossa !\r\n- [x] path-directives/pathSingleSlash.rst thanks @fagossa !\r\n- [x] path-directives/pathSuffix.rst thanks @fagossa !\r\n- [x] path-directives/pathSuffixTest.rst thanks @fagossa !\r\n- [x] path-directives/rawPathPrefix.rst thanks @fagossa !\r\n- [x] path-directives/rawPathPrefixTest.rst thanks @fagossa !\r\n- [x] path-directives/redirectToNoTrailingSlashIfPresent.rst thanks @fagossa !\r\n- [x] path-directives/redirectToTrailingSlashIfMissing.rst thanks @fagossa !\r\n- [ ] range-directives/withRangeSupport.rst\r\n- [x] respond-with-directives/respondWithDefaultHeader.rst thanks @felipefzdz!\r\n- [x] respond-with-directives/respondWithDefaultHeaders.rst thanks @felipefzdz!\r\n- [x] respond-with-directives/respondWithHeader.rst thanks @felipefzdz!\r\n- [x] respond-with-directives/respondWithHeaders.rst thanks @felipefzdz!\r\n- [x] route-directives/complete.rst\r\n- [x] route-directives/failWith.rst\r\n- [x] route-directives/redirect.rst\r\n- [x] route-directives/reject.rst\r\n- [x] scheme-directives/extractScheme.rst thanks @fagossa !\r\n- [x] scheme-directives/scheme.rst thanks @fagossa !\r\n- [x] security-directives/authenticateBasic.rst\r\n- [x] security-directives/authenticateBasicAsync.rst\r\n- [x] security-directives/authenticateBasicPF.rst\r\n- [x] security-directives/authenticateBasicPFAsync.rst\r\n- [x] security-directives/authenticateOAuth2.rst\r\n- [x] security-directives/authenticateOAuth2Async.rst\r\n- [x] security-directives/authenticateOAuth2PF.rst\r\n- [x] security-directives/authenticateOAuth2PFAsync.rst\r\n- [x] security-directives/authenticateOrRejectWithChallenge.rst\r\n- [x] security-directives/authorize.rst\r\n- [x] security-directives/authorizeAsync.rst\r\n- [x] security-directives/extractCredentials.rst\r\n- [x] timeout-directives/withoutRequestTimeout.rst thanks @gosubpl!\r\n- [x] timeout-directives/withRequestTimeout.rst thanks @gosubpl!\r\n- [x] timeout-directives/withRequestTimeoutResponse.rst thanks @gosubpl!\r\n- [x] websocket-directives/handleWebSocketMessages.rst\r\n- [x] websocket-directives/handleWebSocketMessagesForProtocol.rst\n"},"comment":{"url":"https://api.github.com/repos/akka/akka-http/issues/comments/245865523","html_url":"https://github.com/akka/akka-http/issues/218#issuecomment-245865523","issue_url":"https://api.github.com/repos/akka/akka-http/issues/218","id":245865523,"user":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"created_at":"2016-09-09T09:30:04Z","updated_at":"2016-09-09T09:30:04Z","body":"<a href=\"https://github.com/ktoso\"><img src=\"https://avatars.githubusercontent.com/u/120979?v=3\" align=\"left\" width=\"48\" height=\"48\" hspace=\"10\"></img></a> **Comment by [ktoso](https://github.com/ktoso)**\n_Tuesday May 31, 2016 at 17:20 GMT_\n\n----\n\nThat's great, thank you! :-)\n"}}
{"actor":{"display_login":"ktoso"}}