Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xenit-eu/java-hal-client
Hateoas and Hal client for Java
https://github.com/xenit-eu/java-hal-client
Last synced: 6 days ago
JSON representation
Hateoas and Hal client for Java
- Host: GitHub
- URL: https://github.com/xenit-eu/java-hal-client
- Owner: xenit-eu
- License: apache-2.0
- Created: 2024-06-12T12:52:21.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-12-20T20:39:33.000Z (13 days ago)
- Last Synced: 2024-12-20T21:38:12.803Z (13 days ago)
- Language: Java
- Size: 158 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ContentGrid HAL Forms Client
## Context
This is a minimal HAL and HAL-FORMS client, to be used with integration tests.
## Usage
```
var halFormsClient = HalFormsClient.builder().restClient(restClient).build();var orgs = halFormsClient.follow(HalLink.from(URI.create("http://api.contentgrid.test/orgs")));
var myOrg = halFormsClient.requestDefaultTemplate(orgs)
.properties(Map.of("display_name", "test"))
.execute().toHalDocument();var projects = halFormsClient.follow(myOrg.getRequiredLink("projects"));
var testProject = halFormsClient.requestDefaultTemplate(projects)
.properties(Map.of("name", "test"))
.execute().toHalDocument();```
## Possible improvements
* [ ] More explicit support for OAuth2 clients
* [ ] Use Spring HATEOAS concepts: `RepresentationModel`
* [ ] Use Spring HATEOAS / Traverson concepts: `LinkRelation`, `LinkDiscoverer`, ...
* [ ] Base internals on `RestOperations` to improve testability, potentially using `RestOperationsAdapter`
* [ ] Add support to automatically follow redirects (HTTP 302)
* [ ] Let `DefaultHalFormsClient` extend `DefaultHalClient` to avoid duplication (possibly via ServiceLoader)