chore: resolve Object langAliases in function argument types#1908
Merged
yury-s merged 2 commits intomicrosoft:mainfrom Apr 9, 2026
Merged
chore: resolve Object langAliases in function argument types#1908yury-s merged 2 commits intomicrosoft:mainfrom
yury-s merged 2 commits intomicrosoft:mainfrom
Conversation
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<ScreencastFrame> 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) <noreply@anthropic.com>
dgozman
approved these changes
Apr 9, 2026
dgozman
approved these changes
Apr 9, 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.
Summary
convertBuiltinTypeconsultlangAliasesfor innerObjecttypes when nocustomTypeis set, so function-arg Objects (whichcreateClassesAndEnumsdoes not visit) get their Java name from the alias.Screencast.start.options.onFrame -> Consumer<ScreencastFrame>).alias-java: ScreencastFrameupstream,Screencast.javastill producesConsumer<ScreencastFrame>, just via the general 1-arg Promise function path instead of a one-off branch.The remaining
WebSocketRoute.onClose.handler -> BiConsumer<Integer, String>case is left in place — its arguments are nullable primitives, not Objects, so it can't be expressed as an Object alias and would need general 2-arg-function support to remove.