Skip to content

docs: alias drop-payload Object types and dedupe identical aliases#40651

Merged
yury-s merged 1 commit intomicrosoft:mainfrom
yury-s:alias-drop-payload
May 5, 2026
Merged

docs: alias drop-payload Object types and dedupe identical aliases#40651
yury-s merged 1 commit intomicrosoft:mainfrom
yury-s:alias-drop-payload

Conversation

@yury-s
Copy link
Copy Markdown
Member

@yury-s yury-s commented May 5, 2026

Summary

The ## drop-payload block in docs/src/api/params.md was missing the
language alias annotations that ## input-files carries, so language ports
that need a concrete type for the inline [Object] fall back to ambiguous
generated names (e.g. Java's generator was emitting Files.java / Payload.java
duplicating the existing FilePayload and using a generic Payload name).

Adds:

  • alias: DropPayload on the outer payload Object.
  • alias: FilePayload on the inner files field's Object union.

While at it, dedupe alias-csharp: X + alias-java: X pairs to a single
alias: X where the values are identical (the api parser maps the bare
alias: to the default key, which language generators consume as a
fallback). Affects input-files and the new drop-payload block.

No api shape change — this only adds/normalizes type names for the inline
Object types.

Test plan

  • API_JSON_MODE=1 node utils/doclint/generateApiJson.js — parses cleanly
  • regenerated api.json picks up the aliases (verified langAliases.default
    is present on Locator.drop.payload, the inner files Object, and
    setInputFiles.files Object)

Comment thread docs/src/api/params.md
- `payload` <[Object]>
- alias: DropPayload
- `files` ?<[path]|[Array]<[path]>|[Object]|[Array]<[Object]>>
- alias: FilePayload
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can use the same alias in multiple places, we rather need mixins to avoid issues.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would be a bigger refactoring unrelated to this roll as we already have this logic in other places too

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not let this logic in if I was reviewing it, let's use this as an opportunity to fix it. Should be a 1 min job

@yury-s yury-s merged commit ed16508 into microsoft:main May 5, 2026
3 checks passed
@yury-s yury-s deleted the alias-drop-payload branch May 5, 2026 23:50
yury-s added a commit to yury-s/playwright-java that referenced this pull request May 6, 2026
Ports the following upstream client-side PRs:

- microsoft/playwright#39767 - feat: Add `location()` to `WebError`
- microsoft/playwright#39950 - feat: page version of toMatchAriaSnapshot
- microsoft/playwright#40083 - feat(locator): add `description` option to getByRole
- microsoft/playwright#40092 - feat(expect): support pseudo-element in toHaveCSS
- microsoft/playwright#40159 - feat(tracing): add tracing.startHar / tracing.stopHar
- microsoft/playwright#40196 - chore: remove deprecated `handle` option from exposeBinding
- microsoft/playwright#40215 - feat(api): Locator.highlight({ style })
- microsoft/playwright#40219 - feat(api): Page.hideHighlight, Locator.hideHighlight, highlight() returns AutoCloseable
- microsoft/playwright#40283 - feat(locator): add drop API for files and clipboard-like data
- microsoft/playwright#40315 - feat(browser): Browser.onContext / offContext
- microsoft/playwright#40341 - feat(browsercontext): mirror Page lifecycle events on BrowserContext
- microsoft/playwright#40377 - feat(route): expose WebSocket subprotocols on WebSocketRoute
- microsoft/playwright#40606 - feat(api): unify WebError and ConsoleMessage location
- microsoft/playwright#40651 - docs: alias drop-payload Object types

Protocol shape change for FrameExpectResult.received (now `{ value, ariaSnapshot }` instead
of a bare SerializedValue) — updated AssertionsBase to unwrap it.

Generator updates: added new types to relevant import lists; share topLevelTypes between
the assertion and non-assertion generate runs so PseudoElement gets emitted into options/.
Adds the missing `alias: DropPayload` and `alias: FilePayload` annotations
on the `Locator.drop` payload Object types so the language ports can use
proper class names instead of generic ones.

While at it, replace `alias-csharp: X` + `alias-java: X` pairs with a
single `alias: X` (which the api parser maps to the `default` key) where
the values are identical. Affected entries: `input-files`, `drop-payload`.
yury-s added a commit to yury-s/playwright-java that referenced this pull request May 6, 2026
Ports the following upstream client-side PRs:

- microsoft/playwright#39767 - feat: Add `location()` to `WebError`
- microsoft/playwright#39950 - feat: page version of toMatchAriaSnapshot
- microsoft/playwright#40083 - feat(locator): add `description` option to getByRole
- microsoft/playwright#40092 - feat(expect): support pseudo-element in toHaveCSS
- microsoft/playwright#40159 - feat(tracing): add tracing.startHar / tracing.stopHar
- microsoft/playwright#40196 - chore: remove deprecated `handle` option from exposeBinding
- microsoft/playwright#40215 - feat(api): Locator.highlight({ style })
- microsoft/playwright#40219 - feat(api): Page.hideHighlight, Locator.hideHighlight, highlight() returns AutoCloseable
- microsoft/playwright#40283 - feat(locator): add drop API for files and clipboard-like data
- microsoft/playwright#40315 - feat(browser): Browser.onContext / offContext
- microsoft/playwright#40341 - feat(browsercontext): mirror Page lifecycle events on BrowserContext
- microsoft/playwright#40377 - feat(route): expose WebSocket subprotocols on WebSocketRoute
- microsoft/playwright#40606 - feat(api): unify WebError and ConsoleMessage location
- microsoft/playwright#40651 - docs: alias drop-payload Object types

Protocol shape change for FrameExpectResult.received (now `{ value, ariaSnapshot }` instead
of a bare SerializedValue) — updated AssertionsBase to unwrap it.

Generator updates: added new types to relevant import lists; share topLevelTypes between
the assertion and non-assertion generate runs so PseudoElement gets emitted into options/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants