lumnik. / scenarios All scenarios · Français

Spring changes its page JSON and one line follows

Goal Read a Spring Boot app's whole catalogue, page after page, before and after the team changes how its Pages are serialized.

A Spring controller returns the repository's Page. lumnik reads it with a preset:

manifests/lab-docker-compose.yml
# A hand-written Spring Boot 3.4 controller returning the repository's Page. PAGE_SERIALIZATION# is the team's choice: direct (Spring's default, with its warning) or via-dto (what that warning recommends).name: lumnik-spring-catalogservices:  catalog:    build: ../run/catalog-app    environment:      PAGE_SERIALIZATION: ${PAGE_SERIALIZATION:-direct}    ports: ["127.0.0.1:${CATALOG_PORT:-9280}:8080"]   # this machine only
manifests/10-articles.yaml
apiVersion: connectors.lumnik.io/v1kind: Connectormetadata:  name: scenario-spring-page-a  connector_type: rest-generic  scopes: [catalogue]spec:  base_url: http://host.docker.internal:9280/api  endpoints:    - id: articles      path: /articles      method: GET      pagination: { kind: spring-page, size: 50 }      # a Spring Data Page, serialized as is      target:        kind: hybrid        table: ext.scenario_spring_page_a        unique_key: $.ref        promote:          - { name: label, path: $.label, type: text }          - { name: family, path: $.family, type: text }          - { name: price_cents, path: $.priceCents, type: integer }
$ lm apply -f manifests/10-articles.yaml
Applied connector "scenario-spring-page-a" — 1 endpoint

$ lm connector run scenario-spring-page-a
run scheduled: ecd4bc8c-db12-4ae0-b7ae-8aa8e4486580

$ lm run get ecd4bc8c-db12-4ae0-b7ae-8aa8e4486580
ID        CONNECTOR               ENDPOINT  STATUS     IN   OUT  SKIPPED  DEAD-LETTERS  STARTED           ENDED             EVALUATED
ecd4bc8c  scenario-spring-page-a  articles  Completed  130  130  0        0             2026-10-30 23:25  2026-10-30 23:25  yes
manifests/20-articles-paged-model.yaml
apiVersion: connectors.lumnik.io/v1kind: Connectormetadata:  name: scenario-spring-page-a  connector_type: rest-generic  scopes: [catalogue]spec:  base_url: http://host.docker.internal:9280/api  endpoints:    - id: articles      path: /articles      method: GET      pagination: { kind: spring-paged-model, size: 50 }   # the same Page under VIA_DTO: PagedModel      target:        kind: hybrid        table: ext.scenario_spring_page_a        unique_key: $.ref        promote:          - { name: label, path: $.label, type: text }          - { name: family, path: $.family, type: text }          - { name: price_cents, path: $.priceCents, type: integer }

Limits

  • A lab app, written for the scenario with Spring's own classes; not a published product.
  • Under VIA_DTO, spring-page loses nothing: the cost is one empty request, and a preset that no longer matches.
  • Synthetic articles.

Catalogue · articles

The catalogue lives in a Spring Boot app.

Every article must be read, every night.

Spring Boot 3.4, a lab app

The problem

The app returns its articles in pages.

  • Each page says how many there are.
  • One day, the team changes the shape of that answer.

What is not changed

The app's code stays its own.

  • The controller returns Spring's Page.
  • The serialization is the team's choice.

What had to be written

pagination: { kind: spring-page }

Name the framework.

A 23-line connector: 130 articles, 3 requests.

The change

The team follows Spring's warning.

  • The total moves under page.
  • The hub reads everything, one empty page too many.

The fix

pagination: { kind: spring-paged-model }

One line changes.

  • 3 requests again.
  • 130 articles, one row each.

The limit

A lab app, not a published product.

  • Written with Spring's own classes.
  • Without the right preset, nothing is lost: one request too many.

Try it

The scenario replays locally.

Every step is published with its output.

This scenario runs on lumnik Open, free and open source.

Try lumnik Open →