Skip to content

Commit

Permalink
fix(java): Don't generate pagination with nonempty path (#5385)
Browse files Browse the repository at this point in the history
* fix(java): Don't generate pagination with nonempty path

* test run

* changelog entry

* Add streaming-parameter to expected failures

* Format

---------

Co-authored-by: Alberto <alberto@buildwithfern.com>
  • Loading branch information
ajgateno and Alberto authored Dec 11, 2024
1 parent eb5316e commit d1fba2d
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,10 @@ public JsonResponseBodyWithProperty _visitUnknown(Object unknownType) {
httpEndpoint.getPagination().get().visit(new Visitor<Void>() {
@Override
public Void visitCursor(CursorPagination cursor) {
if (cursor.getPage().getPropertyPath().isPresent()
&& !cursor.getPage().getPropertyPath().get().isEmpty()) {
return null;
}
SnippetAndResultType nextSnippet = getNestedPropertySnippet(
cursor.getNext().getPropertyPath(),
cursor.getNext().getProperty(),
Expand Down Expand Up @@ -797,6 +801,10 @@ public String _visitUnknown(Object o) {

@Override
public Void visitOffset(OffsetPagination offset) {
if (offset.getPage().getPropertyPath().isPresent()
&& !offset.getPage().getPropertyPath().get().isEmpty()) {
return null;
}
com.fern.ir.model.types.TypeReference pageType = offset.getPage()
.getProperty()
.visit(new RequestPropertyValue.Visitor<com.fern.ir.model.types.TypeReference>() {
Expand Down
7 changes: 7 additions & 0 deletions generators/java/sdk/versions.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
- changelogEntry:
- summary: |
Don't generate pagination with nonempty path. Fixes pagination seed tests breaking.
type: fix
createdAt: '2024-12-10'
irVersion: 53
version: 2.6.0
- changelogEntry:
- summary: |
Bump IR version to latest (v53)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions seed/java-sdk/object/src/main/java/com/seed/object/types/Type.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion seed/java-sdk/seed.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
irVersion: v46
irVersion: v53
displayName: Java SDK
changelogLocation: ../../generators/java/sdk/versions.yml
image: fernapi/fern-java-sdk
Expand Down Expand Up @@ -100,3 +100,4 @@ allowedFailures:
- query-parameters
- trace
- unions
- streaming-parameter

0 comments on commit d1fba2d

Please sign in to comment.