{"action":"created","issue":{"url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/469","labels_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/469/labels{/name}","comments_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/469/comments","events_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/469/events","html_url":"https://github.com/4finance/micro-infra-spring/issues/469","id":93535251,"number":469,"title":"Better query parameters syntax using DSL","user":{"login":"dstepanov","id":666879,"avatar_url":"https://avatars.githubusercontent.com/u/666879?v=3","gravatar_id":"","url":"https://api.github.com/users/dstepanov","html_url":"https://github.com/dstepanov","followers_url":"https://api.github.com/users/dstepanov/followers","following_url":"https://api.github.com/users/dstepanov/following{/other_user}","gists_url":"https://api.github.com/users/dstepanov/gists{/gist_id}","starred_url":"https://api.github.com/users/dstepanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dstepanov/subscriptions","organizations_url":"https://api.github.com/users/dstepanov/orgs","repos_url":"https://api.github.com/users/dstepanov/repos","events_url":"https://api.github.com/users/dstepanov/events{/privacy}","received_events_url":"https://api.github.com/users/dstepanov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/4finance/micro-infra-spring/labels/discussion","name":"discussion","color":"fef2c0"},{"url":"https://api.github.com/repos/4finance/micro-infra-spring/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-07T13:53:45Z","updated_at":"2015-07-27T01:48:37Z","closed_at":null,"body":"It would be nice to have better support for query parameters via DSL:\r\n\r\n```java\r\n        serviceRestClient.forService(\"users-service\").\r\n                get().\r\n                onUrl(\"users\").\r\n                withQueryParameters().\r\n                    parameter(\"size\", 123).\r\n                    parameter(\"sort\", willBeIgnoredIfnull).\r\n                    parameter(\"filter\", supportJava8OptionalInTheFuture).\r\n                andExecuteFor().\r\n                anObject().\r\n                ofType(String.class)\r\n```\r\nWhen parameter's value is null it will be ignored: no `param=null` in URL, there could be an option to keep parameter with null value.\r\n\r\nWDYT?"},"comment":{"url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/comments/125059195","html_url":"https://github.com/4finance/micro-infra-spring/issues/469#issuecomment-125059195","issue_url":"https://api.github.com/repos/4finance/micro-infra-spring/issues/469","id":125059195,"user":{"login":"piotrpietrzak","id":1497967,"avatar_url":"https://avatars.githubusercontent.com/u/1497967?v=3","gravatar_id":"","url":"https://api.github.com/users/piotrpietrzak","html_url":"https://github.com/piotrpietrzak","followers_url":"https://api.github.com/users/piotrpietrzak/followers","following_url":"https://api.github.com/users/piotrpietrzak/following{/other_user}","gists_url":"https://api.github.com/users/piotrpietrzak/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrpietrzak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrpietrzak/subscriptions","organizations_url":"https://api.github.com/users/piotrpietrzak/orgs","repos_url":"https://api.github.com/users/piotrpietrzak/repos","events_url":"https://api.github.com/users/piotrpietrzak/events{/privacy}","received_events_url":"https://api.github.com/users/piotrpietrzak/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T01:48:37Z","updated_at":"2015-07-27T01:48:37Z","body":"I have just implemented this feature exactly as you suggested. Please review PR #478 and we can merge this and/or we can discuss about some cleanup...\r\n\r\nI think we can \"upgrade\" params - this map is main data holder in entire DSL - we can upgrade this object from map to something more sophisticated like in example object with state control to hold parts of URL like params, query params, base url and so on; in params we also hold headers data. \r\nThen we can refactor this ugly URL updating to more civilized construction based on \"context object\" state. \r\nUrlUtils should be ported as part of implementation of such context. WithHeaders can be also implemented with such context to something which does not need to call updateHeaderParams() with every operation."}}