microsoft / playwright-java

Java version of the Playwright testing and automation library
https://playwright.dev/java/
Apache License 2.0
1.07k stars 195 forks source link

[Bug]: Playwright excludes null when serializing request #1585

Closed niekvanderkooy closed 1 month ago

niekvanderkooy commented 1 month ago

Version

1.44.0

Steps to reproduce

Map<String, Object> data = new HashMap<>();
data.put("id", 1);
data.put("someNullField", null);

RequestOptions options = RequestOptions.create();
options.setData(data);

apiRequestContext.post("endpoint", data);

Expected behavior

someNullField to be sent to the API as data, with value null

Actual behavior

someNullField is filtered out.

Additional context

Similar bug seems to has been fixed in other language libraries (dotnet issue: https://github.com/microsoft/playwright-dotnet/issues/2509 )

Environment

Java 21