{"id":19299944,"url":"https://github.com/cloudogu/jaxrs-tie","last_synced_at":"2026-02-25T23:02:12.944Z","repository":{"id":57718281,"uuid":"151150610","full_name":"cloudogu/jaxrs-tie","owner":"cloudogu","description":"Generates link builder from JAX-RS annotation","archived":false,"fork":false,"pushed_at":"2024-09-17T14:34:21.000Z","size":187,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2024-09-17T17:23:57.629Z","etag":null,"topics":["annotation","annotation-processor","hateoas","java","jax-rs","jax-rs-annotations","jax-rs-resources","jax-rs-tie","link","link-builder"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudogu.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-01T19:58:07.000Z","updated_at":"2024-09-13T12:04:06.000Z","dependencies_parsed_at":"2024-09-17T17:13:20.397Z","dependency_job_id":"521a911e-74d4-48ba-8dc0-82e71c0e740a","html_url":"https://github.com/cloudogu/jaxrs-tie","commit_stats":null,"previous_names":["sdorra/jaxrs-tie"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudogu%2Fjaxrs-tie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudogu%2Fjaxrs-tie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudogu%2Fjaxrs-tie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudogu%2Fjaxrs-tie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudogu","download_url":"https://codeload.github.com/cloudogu/jaxrs-tie/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223893055,"owners_count":17220834,"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":["annotation","annotation-processor","hateoas","java","jax-rs","jax-rs-annotations","jax-rs-resources","jax-rs-tie","link","link-builder"],"created_at":"2024-11-09T23:13:14.410Z","updated_at":"2026-02-25T23:02:07.926Z","avatar_url":"https://github.com/cloudogu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"left\" alt=\"JAX-RS Tie\" src=\"images/logo.png\" width=\"128\" height=\"128\" /\u003e\n\n# JAX-RS Tie\n\nGenerate a type safe link builder from your JAX-RS annotations.\n\n## Why?\n\nIn modern rest applications it is usual to generate links between resources ([Rest Maturity Model Level 3](https://martinfowler.com/articles/richardsonMaturityModel.html#level3)).\n\nIn JAX-RS resources can be linked using a [UriBuilder](https://jakarta.ee/specifications/restful-ws/3.0/apidocs/jakarta/ws/rs/core/uribuilder) for example:\n\n```java\n@GET\n@Path(\"{planet}\")\npublic String planetLink(@Context UriInfo uriInfo, @PathParam(\"planet\") String planetName) {\n  return uriInfo.getBaseUriBuilder()\n                .path(PlanetResource.class)\n                .path(PlanetResource.class, \"planet\")\n                .build(planetName)\n                .toASCIIString();\n}\n```\n\nThe code above generates a link which points to the `planet` method of the `PlanetResource`.\n\nIt seams easy, but there are problems with this approach:\n\n* Methods are passed as strings, which could cause problems if a method is renamed during a refactoring\n* If we are using sub resources, we have to rememeber the hirachy e.g.: \n\n```java\nuriInfo.getBaseUriBuilder()\n       .path(PersonResource.class, \"person\")\n       .path(\"luke\")\n       .path(PlanetResource.class, \"planet\")\n       .build(\"tatooine\");\n```\n\nJAX-RS Tie tries to tacle both problems.\nIt will generate a link builder which is automatically regenerated if a resources changes \nand it map the hirachy or the resources.\n\nWith JAX-RS Tie link generation could be look as the following:\n\n```java\n@GET\n@Path(\"{planet}\")\npublic String planetLink(@Context UriInfo uriInfo, @PathParam(\"planet\") String planetName) {\n  return new SwLinks(uriInfo).planets()\n                             .planet(planetName)\n                             .asString();\n}\n``` \n\n## Usage\n\nOnly a single annotation is required to use JAX-RS Tie.\nJust annotate a class with the `@GenerateLinkBuilder` annotation and JAX-RS Tie generates the link builder\nwith the name of the annotated class and appends \"Links\" to the name e.g.: \n\n```java\n@GenerateLinkBuilder\nclass StarWars {}\n```\n\nThe example above will create a `StarWarsLinks` link builder in the same package as the `StarWars` class.\nThe link builder will automatically find all JAX-RS resources which are annotated with the `@Path` annotation.\n\n## Installation\n\nGet the latest stable version from [![Maven Central](https://img.shields.io/maven-central/v/com.cloudogu.jaxrs-tie/jaxrs-tie.svg)](https://search.maven.org/search?q=g:com.cloudogu.jaxrs-tie%20a:jaxrs-tie)\n\n### Gradle\n\n```groovy\ncompileOnly 'com.cloudogu.jaxrs-tie:jaxrs-tie:x.y.z'\nannotationProcessor 'com.cloudogu.jaxrs-tie:jaxrs-tie:x.y.z'\n```\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.cloudogu.jaxrs-tie\u003c/groupId\u003e\n  \u003cartifactId\u003ejaxrs-tie\u003c/artifactId\u003e\n  \u003cversion\u003ex.y.z\u003c/version\u003e\n  \u003coptional\u003etrue\u003c/optional\u003e\n\u003c/dependency\u003e\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudogu%2Fjaxrs-tie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudogu%2Fjaxrs-tie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudogu%2Fjaxrs-tie/lists"}