fix(typescript): ignore pagination field mismatches in wire test mock server#11490
Merged
fern-support merged 12 commits intomainfrom Jan 12, 2026
Merged
fix(typescript): ignore pagination field mismatches in wire test mock server#11490fern-support merged 12 commits intomainfrom
fern-support merged 12 commits intomainfrom
Conversation
…rate bug Co-Authored-By: [email protected] <[email protected]>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…onse type Co-Authored-By: [email protected] <[email protected]>
Co-Authored-By: [email protected] <[email protected]>
Collaborator
There was a problem hiding this comment.
can we push pagination. into the tests themselves instead of the helpers?
…ields
Address reviewer feedback to remove hardcoded pagination. filtering from
withJson.ts and instead pass pagination field paths from the IR.
Changes:
- Remove hardcoded !key.startsWith("pagination.") check from withJson.ts
- Update TestGenerator.ts to build full path for both cursor and offset
pagination types (e.g., "pagination.cursor" or "cursor" or "pagination.offset")
- Use originalName for PropertyPathItem.name and wireValue for property.name
Co-Authored-By: [email protected] <[email protected]>
… for all pagination types Co-Authored-By: [email protected] <[email protected]>
…w top-level cursor endpoint Co-Authored-By: [email protected] <[email protected]>
fern-support
approved these changes
Jan 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refs: Customer bug report (Square)
Fixes wire test failures when pagination tests call
getNextPage(). The SDK correctly sends the cursor/offset from the response, but the mock server was rejecting the request because the value didn't match the original request body.Link to Devin run: https://app.devin.ai/sessions/569f5162819c47c4ba95afbfde8313de
Requested by: @jsklan
Changes Made
WithJsonOptionsinterface towithJson.tswith anignoredFieldsparameter for specifying fields to ignore during request body comparison!key.startsWith("pagination.")filtering fromwithJson.ts(per reviewer feedback)mockEndpointBuilder.tsto passignoredFieldsthrough thejsonBodymethodTestGenerator.tsto extract pagination field paths from the IR for both cursor AND offset pagination types, building the full path (e.g.,"pagination.cursor","cursor","pagination.offset")listWithTopLevelBodyCursorPaginationwith a top-level cursor field in the request body to demonstrate the bugTesting
ignoredFieldsfor both top-level and nested pagination fieldsUpdates Since Last Revision
pagination.filtering fromwithJson.tsTestGenerator.tsto build full paths for ALL pagination types (cursor and offset), not just top-level cursor fieldsoriginalNameforPropertyPathItem.nameandwireValueforproperty.nameto correctly construct field pathspagination.jsonin dynamic-snippets and ir test-definitions)Human Review Checklist
TestGenerator.tscorrectly handles both nested paths (e.g.,pagination.cursor) and top-level paths (e.g.,cursor)PropertyPathItem.nameusesoriginalName, whileproperty.nameuseswireValuepagination.offsetfield should now be inignoredFields)listWithTopLevelBodyCursorPaginationendpoint properly demonstrates the bug