odrotbohm on 2.0.1
odrotbohm on 2.0.x
#1897 - Release version 2.0.1. #1897 - Prepare next developmen… (compare)
odrotbohm on release
#1881 - Prepare next developmen… #1887 - Avoid trailing slash fo… #1888 - Upgrade to Spring Asci… and 10 more (compare)
odrotbohm on 2.0.x
#1897 - Update changelog. (compare)
odrotbohm on 2.0.x
#1888 - Upgrade to Spring Asci… #1889 - Upgrade to Logback 1.4.… #1890 - Upgrade to Jackson 2.14… and 6 more (compare)
odrotbohm on 2.0.x
#1887 - Avoid trailing slash fo… (compare)
odrotbohm on main
#1886 - Avoid trailing slash fo… (compare)
odrotbohm on 2.0.x
#1886 - Avoid trailing slash fo… (compare)
odrotbohm on 2.0.x
#1881 - Prepare next developmen… (compare)
odrotbohm on 1446-html
Hacking. (compare)
odrotbohm on 2.0.0
odrotbohm on main
#1881 - Release version 2.0.0. #1881 - Prepare next developmen… (compare)
odrotbohm on release
#1881 - Release version 2.0.0. (compare)
odrotbohm on main
#1882 - Fix settings.xml to use… (compare)
odrotbohm on release
#1881 - Release version 2.0.0. (compare)
odrotbohm on release
odrotbohm on main
#1881 - Configure Maven Release… (compare)
odrotbohm on main
#1881 - Fix flaky test. (compare)
Hello folks, I just wanted to use spring-hateos-jsonapi lib for my project, but found I can't, I raised the issue toedter/spring-hateoas-jsonapi#8 where @toedter pointed me to discuss the things here. Please could you take a look at my arguments and revisit the decision?
To sum up:
Since neither spring-hateos nor spring-hateoas-jsonapi declare they are spring-boot -only, I believe the configurations could be public.
I’m pleased to announce the release of Spring HATEOAS Siren 1.0.0-M2!
The library is accessible through Maven Central or one of it’s proxies.
Source: https://github.com/ingogriebsch/spring-hateoas-siren
Documentation: https://ingogriebsch.github.io/spring-hateoas-siren
Every feedback is very welcome! :)
Why ask users to do that?
I don't understand the question!
Yes, we should open an issue
@gregturn Is this sufficient? Or do you have another summary/description in mind? spring-projects/spring-hateoas#1374
But we also have to maintain Traverson in a backward compatible way.
Would it not be sufficient to remove the check that only one TraversonDefaults is available?
Hello, I have a problem with the configuration of my project in which I use Kotlin+Coroutines. When I put @EnableHypermediaSupport(type = [EnableHypermediaSupport.HypermediaType.HAL_FORMS], stacks = [WebStack.WEBFLUX])
I started to get an exception:
java.lang.NoSuchMethodError: 'reactor.core.publisher.Mono reactor.core.publisher.Mono.contextWrite(java.util.function.Function)'
at org.springframework.web.filter.reactive.ServerWebExchangeContextFilter.filter(ServerWebExchangeContextFilter.java:50) ~[spring-web-5.3.0-RC1.jar:5.3.0-RC1]
at org.springframework.web.server.handler.DefaultWebFilterChain.invokeFilter(DefaultWebFilterChain.java:127) ~[spring-web-5.3.0-RC1.jar:5.3.0-RC1]
at org.springframework.web.server.handler.DefaultWebFilterChain.lambda$filter$0(DefaultWebFilterChain.java:121) ~[spring-web-5.3.0-RC1.jar:5.3.0-RC1]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:44) ~[reactor-core-3.3.10.RELEASE.jar:3.3.10.RELEASE]
...
What I'm doing wrong ?
dependencies {
implementation platform("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-hateoas") {
exclude(group: "org.springframework.boot", module: "spring-boot-starter-web")
}
constraints {
implementation("org.springframework.hateoas:spring-hateoas:1.2.0-RC1")
}
HalResponseModel
(which could take the _embedded
) is not public and all other representation classes simply do not use all HAL properties. What am I supposed to do with my WebTestClient
if I want to check for all links, embeds, … in my response?
ResourceAssemblerSupport
planned for the reactive stack as well? Right now we try to stick to the passtern and simply create our own @Components for such purposes.
class ResourceAssemblerWithCustomLinkSimple implements SimpleReactiveRepresentationModelAssembler<Employee> {
@Override
public EntityModel<Employee> addLinks(EntityModel<Employee> resource,
ServerWebExchange exchange) {
return resource.add(Link.of("/employees").withRel("employees"));
}
@Override
public CollectionModel<EntityModel<Employee>> addLinks(
CollectionModel<EntityModel<Employee>> resources, ServerWebExchange exchange) {
return resources.add(Link.of("/").withRel("root"));
}
}
@gregturn Yeah … right now we do something along
val model = mock<DraftResponseModel>()
fun links(): Mono<List<Link>> = TODO()
fun previewForSomething(): Mono<Tuple2<Link, DraftResponseModel>> = TODO()
model.toMono()
.zipWith(links()) { model, links ->
HalModelBuilder.halModelOf(model)
.links(links)
}
.zipWith(previewForSomething()) { builder, (link, preview) ->
builder.preview(preview)
.forLink(link)
}
.map { it.build() }
what do you think?
mapper.registerModule(new JavaTimeModule());
mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
One way wuld be something like
@Configuration
@WebAppConfiguration
@EnableWebMvc
@EnableHypermediaSupport(type = HAL)
static class TestConfig {
@Bean
JsonApiMediaTypeConfiguration jsonApiMediaTypeConfiguration(ObjectProvider<JsonApiConfiguration> configuration,
AutowireCapableBeanFactory beanFactory) {
return new JsonApiMediaTypeConfiguration(configuration, beanFactory) {
@Override
ObjectMapper configureObjectMapper(ObjectMapper mapper, JsonApiConfiguration configuration) {
ObjectMapper objectMapper = super.configureObjectMapper(mapper, configuration);
objectMapper.registerModule(new JavaTimeModule());
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
return objectMapper;
}
};
}
}
But may there there is a better/easier way.
HalConfig
and HalFormsConfig
, which provides some user-facing APIs to apply tweaks deep inside the relevant serializers.
ObjectMapper
settings.
ObjectMapperCustomizer
sort of lambda function added to HalConfig
would be the simplest way. But I'd also question granting users that much access to the internals.
Something like...
public interface ObjectMapperCustomizer extends Consumer<ObjectMapper> {
}
You provide new HalConfig().customizeObjectMapper(objectMapper -> { /* insert customizations here */})
, and the serializer, after getting/creating the ObjectMapper
, could then invoke halConfig.objectMapperCustomizer.accept(theObjectMapper)
.
Yeah?
I could see this applied to the others as well.