Spring API Gateway - Path regex

Есть Spring API Gateway c следующей конфигурацией:

spring:
  application:
    name: gateway
  cloud:
    gateway:
      discovery:
        locator:
          enabled: true
          lower-case-service-id: true
      default-filters:
        - RewritePath=/api/v1/.*?/(?<remaining>.*), /$\{remaining}
      routes:
        - predicates:
            - Path=/api/v1/stories/**
          uri: lb://story

При запросе к /api/v1/stories/ редирект происходит правильно, но если / в конце убрать /api/v1/stories то получается ошибка:

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Искал ответ тут, но исправить так и не удалось.

Контроллер в story сервисе выглядит так:

@GetMapping
public ResponseEntity<ListDto<StoryDto>> list(@NotNull @RequestBody @Valid StoryFilterDto filter) {
    log.debug("Get Story list by filter: {}", filter);
    return ResponseEntity.ok(storyService.getList(filter));
}

Как сделать так чтобы от слеша в конце можно было избавиться, и отправлять запрос прямо на /api/v1/stories?


Ответы (0 шт):