[js][py][rb] derive BiDi field names and enum value types in the schema - #17966
Conversation
|
Thank you, @titusfortner for this code suggestion. The support packages contain example code that many users find helpful, but they do not necessarily represent After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks. |
PR Summary by QodoDerive BiDi field names and preserve enum primitive types
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
Code Review by Qodo
1. _read_scalar boolean guard untested
|
|
Code review by qodo was updated up to the latest commit 6aa0ca1 |
|
Code review by qodo was updated up to the latest commit e985c8b |
|
Code review by qodo was updated up to the latest commit 9e7530e |
|
Code review by qodo was updated up to the latest commit 657d189 |
|
Code review by qodo was updated up to the latest commit 0628f9c |
|
Code review by qodo was updated up to the latest commit bc250ce |
🔗 Related Issues
Surfaced by #17954, whose CDDL repin caused test failures.
4.48.0 shipped without that repin so this is fixing things for the next release.
💥 What does this PR do?
namealongside the exactwirekey, so each binding derives an attribute name without re-solving punctuation itself🔧 Implementation Notes
nameandwireheld the same value, so a key that is not an identifier (prefers-color-scheme) reached every binding unconverted. A key that already is one is left alone, sonamespaceURIand the other 255 existing keys are unchanged.colorGamutandcolor-gamut), which a Python dataclass would silently accept as an overwrite, socheckSchemarejects it.moz:allowPrivateBrowsing) are exempt —extractVendorroutes them out of the shared types and the vendor pipeline drops the namespace itself.literalPrimitiveand discarded it when hoisting to a named enum, so named enums now keep it. Python and Ruby read that instead of introspecting the values, and Java gets to use its existingprimitiveToJavarather than instanceof-chaining onObject. Without it both bindings sent"0"where"grid": 0 / 1requires0.0into_0, which Python already had and Ruby now matches.🤖 AI assistance
💡 Additional Considerations
parseFieldreadsname, which is now already a valid Java identifier. Its enum path will need the same numeric handling Ruby and Python got here, though, once it rebases past the repin —appendEnumBodytypes values asList<String>,toEnumConstantwould emit0as a constant name, and the generated enum boxes its value as aString.🔄 Types of changes