You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some inputs contain string properties that are in fact enums with a specific set of values. For instance, DispatchMouseEventRequest.type is technically sent as a string on the wire, but is defined as an enum with specific possible values in the protocol.
It would be nice if this was exposed to the user as an enum instead of a string. We would need to make sure that the enum constants are properly defined so that Kotlinx Serialization sends the proper string on the wire.
The text was updated successfully, but these errors were encountered:
The challenge here is that these "inline" enums have no name, so we need to generate one that somehow conveys the correct meaning, which is not reliable and thus not ideal. The better way to fix that would be to actually declare these enums as domain types at the top level, like other object and enum types (see ChromeDevTools/devtools-protocol#244).
If this doesn't happen, one strategy to generate the name of the enum type could be the following:
for properties of an object: the name of the enum type could be the containing object type name suffixed by the capitalized property name. Example
type: LogEntry
property: level
inferred enum type name: LogEntryLevel
for parameters of a command's input/output type: the name of the command without the leading word + the capitalized parameter name. Removing the leading word allows to get rid of the verb of the command (which is the most common case). For example:
command: dispatchDragEvent
parameter: type
inferred enum type name: DragEventType
for parameters of an event: the capitalized name of the event + the capitalized parameter name. For example:
Some inputs contain
string
properties that are in fact enums with a specific set of values. For instance,DispatchMouseEventRequest.type
is technically sent as a string on the wire, but is defined as an enum with specific possible values in the protocol.It would be nice if this was exposed to the user as an enum instead of a string. We would need to make sure that the enum constants are properly defined so that Kotlinx Serialization sends the proper string on the wire.
The text was updated successfully, but these errors were encountered: