Skip to content

Commit b01bf64

Browse files
authored
chore: resolve Object langAliases in function argument types (#1908)
1 parent 7dbd6ca commit b01bf64

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<name>Playwright Client Examples</name>
1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<playwright.version>1.58.0</playwright.version>
13+
<playwright.version>1.59.0</playwright.version>
1414
</properties>
1515
<dependencies>
1616
<dependency>

scripts/DRIVER_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.59.1-beta-1775752988000
1+
1.59.1-beta-1775762078000

tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,12 @@ private String convertBuiltinType(JsonObject jsonType) {
506506
if (customType != null) {
507507
return customType;
508508
}
509+
// Inner Objects (e.g. function arguments) are not visited by createClassesAndEnums,
510+
// so resolve their Java type name from langAliases here.
511+
String alias = javaAlias(jsonType);
512+
if (alias != null) {
513+
return alias;
514+
}
509515
return "Map<" + convertTemplateParams(jsonType) + ">";
510516
}
511517
if ("Map".equals(name)) {
@@ -525,9 +531,6 @@ private String convertBuiltinType(JsonObject jsonType) {
525531
if ("WebSocketRoute.onClose.handler".equals(jsonPath)) {
526532
return "BiConsumer<Integer, String>";
527533
}
528-
if ("Screencast.start.options.onFrame".equals(jsonPath)) {
529-
return "Consumer<ScreencastFrame>";
530-
}
531534
if (jsonType.getAsJsonArray("args").size() == 1) {
532535
String paramType = convertBuiltinType(jsonType.getAsJsonArray("args").get(0).getAsJsonObject());
533536
if (!jsonType.has("returnType") || jsonType.get("returnType").isJsonNull()) {

0 commit comments

Comments
 (0)