spring-hateoas-examples icon indicating copy to clipboard operation
spring-hateoas-examples copied to clipboard

Create WebFlux + Boot example

Open gregturn opened this issue 6 years ago • 1 comments

gregturn avatar Jul 17 '19 12:07 gregturn

That would be very interessting. Especially it looks like that X-Forwarded-Prefix: is no more added to Link in such a scenario

spring:
  main:
    web-application-type: reactive
server:
  forward-headers-strategy: native

Perhaps this could be some example:

private fun wrapInHateoas(someObject: SomeObject): Mono<EntityModel<SomeObject>> =
      someObject
          .toMono()
          .zipWith(linkTo(controller.getSomeObject(someObject.id)).withSelfRel().toMono()) {
              some: SomeObject, link: Link -> EntityModel(some, link)
            }

SchlammSpringer avatar Aug 13 '19 08:08 SchlammSpringer