{"id":21317394,"url":"https://github.com/ibaca/autorest-nominatim-example","last_synced_at":"2025-06-25T06:03:24.157Z","repository":{"id":8272625,"uuid":"57456496","full_name":"ibaca/autorest-nominatim-example","owner":"ibaca","description":"AutoREST Nominatim  [jre, gwt, android, jee] example","archived":false,"fork":false,"pushed_at":"2023-11-26T07:18:00.000Z","size":87,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T12:45:32.163Z","etag":null,"topics":["autorest","gwt","jax-rs","nominatim"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibaca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-30T18:36:29.000Z","updated_at":"2022-05-21T09:33:23.000Z","dependencies_parsed_at":"2022-08-25T03:51:38.822Z","dependency_job_id":null,"html_url":"https://github.com/ibaca/autorest-nominatim-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ibaca/autorest-nominatim-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaca%2Fautorest-nominatim-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaca%2Fautorest-nominatim-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaca%2Fautorest-nominatim-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaca%2Fautorest-nominatim-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibaca","download_url":"https://codeload.github.com/ibaca/autorest-nominatim-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibaca%2Fautorest-nominatim-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261816053,"owners_count":23213840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autorest","gwt","jax-rs","nominatim"],"created_at":"2024-11-21T18:46:37.099Z","updated_at":"2025-06-25T06:03:24.119Z","avatar_url":"https://github.com/ibaca.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoREST Nominatim Example\n\n[AutoREST][AutoREST] generates utility code which should help you extract the request data\non each endpoint call and use it to populate a request. So in simplified example you define…\n\n```java\n@AutoRestGwt @Path(\"search\") interface Nominatim {\n  @GET Observable\u003cSearchResult\u003e search(@QueryParam(\"q\") String query);\n}\n```\n\n[AutoREST][AutoREST] generates a `Nominatim_RestServiceModel`, and you should implement a `ResourceVisitor`\nprovided as factory to the model, this makes your services instantiations similar to…\n\n```java\nNominatim nominatim = new Nominatim_RestServiceModel(DummyResourceVisitor::new);\nnominatim.search(\"málaga\").subscribe(n -\u003e out.println(\"received \" + n));\n```\n\n…on each call to the model (like the previous `.search(\"málaga\")`) a new visitor (like next one) is evaluated…\n\n```java\nclass DummyResourceVisitor {\n  public ResourceVisitor path(Object... paths) { out.println(\"path \" + Arrays.toString(paths)); return this; }\n  public ResourceVisitor param(String key, @Nullable Object value) { out.println(\"param \" + key + \"=\" + value); return this; }\n  public ResourceVisitor method(String method) { out.println(\"method \" + method); return this; }\n  public \u003cT\u003e T as(Class\u003c? super T\u003e container, Class\u003c?\u003e type) { return null; }\n}\n```\n\n…producing this output `\"method GET\" ⏎ \"path [search]\" ⏎ \"param q=málaga\"`.\n\nOk, this dummy visitor makes nothing, just print Request configuration, do not even generate a request. Gathering\nthe request data, creating a request and handling the response into the expected type is now your responsibility.\n**BUT** this project try to demonstrate how moving the responsibility out of the library and giving to\nyou the full control of the request building, request encoding and response decoding is not only much easier, simpler\nand clear as you may expect, but also make it almost trivial to extend and customize your services.\n\n[AutoREST][AutoREST] separates services handling in three responsibilities\n\n* **schema** defines the REST service interface and models using [JAX-RS][jaxrs] standard\n* **request** the goal of client side services is to create a request to transfer the payload\n* **codec** the url, headers and request payload should be encoded/decoded\n\n\u003e You should note that AutoREST should not build the request (althought include a basic implementation),\n\u003e do not implement codecs, and schema definition uses the standard JAX-RS, so not AutoREST involved neither.\n\u003e For all this, AutoREST should be considered a blueprint which help you organize this responsabilities giving\n\u003e a common template and best practices to keep service implementation clean and simple.\n\n## Modules\n\nClient modules of this project shows how to implement the **request** and **codec** responsibilities for\nvarious environments, API module shows how to define the service **schema** in one place and share this schema\nnot only between the different client but also with the server implementation.\n\n* [api module][api] contains the [Nominatim][Nominatim] scheme definition (models as inner classes),\n  and is shared between the other modules\n* client implementations: uses the API to build a request\n    * [jre module][jre]\n    * [gwt module][gwt]\n* server implementations: uses the API to expose a service\n    * [server module][server] implements the [Nominatim][Nominatim] service definition as\n      [ResourceNominatim][Resource], and exposes it using a jetty + jersey + jackson server. Configuration\n      of this libraries are all [here][Main] and you can run the server as an plain java using the `Main.main`.\n\n[api]: https://github.com/ibaca/autorest-nominatim-example/tree/master/api\n\n[jre]: https://github.com/ibaca/autorest-nominatim-example/tree/master/jre\n\n[gwt]: https://github.com/ibaca/autorest-nominatim-example/tree/master/gwt\n\n[server]: https://github.com/ibaca/autorest-nominatim-example/tree/master/server\n\n[Nominatim]: https://github.com/ibaca/autorest-nominatim-example/blob/master/api/src/main/java/com/intendia/gwt/example/client/Nominatim.java\n\n[Resource]: https://github.com/ibaca/autorest-nominatim-example/blob/master/server/src/main/java/com/intendia/gwt/example/ResourceNominatim.java\n\n[Main]: https://github.com/ibaca/autorest-nominatim-example/blob/master/server/src/main/java/com/intendia/gwt/example/Main.java\n\n[jaxrs]: https://jax-rs-spec.java.net/\n\n[AutoREST]: https://github.com/intendia-oss/autorest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibaca%2Fautorest-nominatim-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibaca%2Fautorest-nominatim-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibaca%2Fautorest-nominatim-example/lists"}