Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update toJson() method creation for integer type in CdpClientGenerator. #8997

Merged
merged 2 commits into from
Jan 3, 2021

Conversation

pujagani
Copy link
Contributor

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Related to #8871. Fixes toJson() method's return type for integer parameters.

Motivation and Context

Sending the Cdp command using websocket requires the request to be serialized into Json string, and for this toJson() method of WindowID is used. The CdpClientGenerator generates classes based on the browser_protocol.

While creating WindowID class, the return type for toJson() method was String. As a result following error was received anytime WindowID was used,
WARNING: Unhandled type: {"id":6,"error":{"code":-32602,"message":"Invalid parameters","data":"Failed to deserialize params.windowId - BINDINGS: int32 value expected at position 16"}} .

The changes fix the serialization issue by ensuring Integer return type is added.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@diemol diemol merged commit e0dde49 into SeleniumHQ:trunk Jan 3, 2021
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 3, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

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