From 979f4a99f93f118c788988c627116104dd30c7fa Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 9 Apr 2026 12:11:00 -0700 Subject: [PATCH 1/2] chore: resolve Object langAliases in function argument types Inner Objects nested inside function-typed arguments are not visited by createClassesAndEnums, so the api generator never set customType for them and had to fall back to a hardcoded jsonPath switch (the Screencast.start.onFrame -> Consumer case). Have convertBuiltinType resolve the Java type name from the inner Object's langAliases when no customType is set, and drop the hardcoded onFrame case. This works once microsoft/playwright adds alias-java for the onFrame Object (already proposed upstream). Co-Authored-By: Claude Opus 4.6 (1M context) --- .../com/microsoft/playwright/tools/ApiGenerator.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java b/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java index 14a860af..ba4b59f6 100644 --- a/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java +++ b/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java @@ -506,6 +506,12 @@ private String convertBuiltinType(JsonObject jsonType) { if (customType != null) { return customType; } + // Inner Objects (e.g. function arguments) are not visited by createClassesAndEnums, + // so resolve their Java type name from langAliases here. + String alias = javaAlias(jsonType); + if (alias != null) { + return alias; + } return "Map<" + convertTemplateParams(jsonType) + ">"; } if ("Map".equals(name)) { @@ -525,9 +531,6 @@ private String convertBuiltinType(JsonObject jsonType) { if ("WebSocketRoute.onClose.handler".equals(jsonPath)) { return "BiConsumer"; } - if ("Screencast.start.options.onFrame".equals(jsonPath)) { - return "Consumer"; - } if (jsonType.getAsJsonArray("args").size() == 1) { String paramType = convertBuiltinType(jsonType.getAsJsonArray("args").get(0).getAsJsonObject()); if (!jsonType.has("returnType") || jsonType.get("returnType").isJsonNull()) { From 4cf400340ddaf8e41c607bc9c4db8fbd1c32d888 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 9 Apr 2026 12:22:25 -0700 Subject: [PATCH 2/2] roll beta driver --- examples/pom.xml | 2 +- scripts/DRIVER_VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/pom.xml b/examples/pom.xml index 8029f389..13f95391 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -10,7 +10,7 @@ Playwright Client Examples UTF-8 - 1.58.0 + 1.59.0 diff --git a/scripts/DRIVER_VERSION b/scripts/DRIVER_VERSION index 038e96b8..c8147339 100644 --- a/scripts/DRIVER_VERSION +++ b/scripts/DRIVER_VERSION @@ -1 +1 @@ -1.59.1-beta-1775752988000 +1.59.1-beta-1775762078000