fatmanverse opened a new pull request, #13730:
URL: https://github.com/apache/seatunnel/pull/13730
### Purpose of this pull request
Closes #13728.
`pageing.page_field` is optional and declares the default `page`, but
omitting it leaves the reader page field unset. The reader advances its
internal page index while requests either omit the page number or keep the
original value, so an API can return the same page repeatedly. Explicitly
setting `page_field = "page"` works around the issue.
Apply `HttpSourceOptions.PAGE_FIELD.defaultValue()` when PageNumber
pagination omits the field, while retaining the existing Cursor behavior.
### Does this PR introduce _any_ user-facing change?
Yes. PageNumber requests now use the documented `page` default when
`page_field` is omitted. Explicit custom fields and starting pages are
preserved. Cursor mode does not gain an implicit page-number parameter. There
is no option rename or default change; English/Chinese HTTP docs clarify the
behavior.
Confirmed against `dev` at `0bef81d003a9dcc3266a10140dc639534ad81bfd`;
released versions were not tested.
### How was this patch tested?
Added `HttpSourcePageFieldTest` with 8 cases using a real loopback HTTP
server. Implicit and explicit PageNumber, automatic query injection, existing
params, headers, JSON body, body placeholders, custom field and start page, and
Cursor without an extra page-number parameter.
- Before the fix: 6 cases fail against the original production code.
- After the fix: 79 HTTP-module tests pass independently on JDK 11 and JDK
17, including 8 new cases.
- The affected module and its upstream Maven reactor pass `verify` and
Spotless checks on both JDKs. `spotless:apply` and a separate `-q -DskipTests
verify` also pass.
- Tests and builds ran on a Linux test host. No engine E2E or
whole-repository test run is claimed.
```sh
./mvnw -B -ntp -pl
seatunnel-connectors-v2/connector-http/connector-http-base -am spotless:apply
./mvnw -B -ntp -pl
seatunnel-connectors-v2/connector-http/connector-http-base -am \
-DskipITs -Dsurefire.timeout=60 \
-Dsurefire.failIfNoSpecifiedTests=false -DfailIfNoTests=false \
'-Dtest=Http*Test,JsonField*Test,BinaryResponseCollectorTest,FilenameExtractorTest'
\
clean verify
./mvnw -q -pl seatunnel-connectors-v2/connector-http/connector-http-base -am
-DskipITs -DskipTests verify
```
### Check list
- [x] Added regression tests and updated English/Chinese documentation.
- [x] Reviewed compatibility; no configuration option or public API is
removed or renamed.
- [x] No new dependencies or connector registration changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]