-
Notifications
You must be signed in to change notification settings - Fork 53
fix(session.ProxyConfiguration): make it a group to allow group choices #920
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
base: main
Are you sure you want to change the base?
Conversation
I don't understand what makes it impossible to turn the resulting group into a map directly. Where does RFC8610 suggest that this cannot be done? Looking at existing RFCs that use CDDL, I don't see the exact same pattern but some constructs use group choices within the definition of types: |
I've observed the following areas that indicate that maps can't contain group choices: 📘 RFC 8610, Section 3.5 — Groups in Maps and Arrays
This means: maps accept groups, and groups contain entries. A group choice like A // B is a kind of group — but you must wrap it into a group context and then inject it. 📘 RFC 8610, Section 3.9 — Group-to-Group CompositionThis section introduces the
Implication: 📘 Formal Grammar (Appendix A)In the ABNF grammar: group-entry = [occur] [memberkey [type]] /
[groupname [genericparm]]
group-choice = group-entry *(S "//" S group-entry) And for maps, the structure is: map = "{" [group] "}" This confirms:
I would argue this is incorrect as well.
This is correct use of group choice as I agree that this limitation is not explicitly mentioned in the CDDL spec, though the ABNF grammar supports this. Regardless I suggest we keep the same "style" how we define group choices within the WebDriver Bidi spec and so far we don't use it within maps at all. |
@@ -1713,13 +1713,13 @@ with parameter |value| is: | |||
[=remote end definition=] and [=local end definition=] | |||
|
|||
<pre class="cddl remote-cddl local-cddl"> | |||
session.ProxyConfiguration = { | |||
session.ProxyConfiguration = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with this change we will be loosing the type information for the proxy field in session.CapabilityRequest. Instead, I think we can wrap the group choice into an extra ()
to make sure it is a group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that looks fine. @OrKoN do you have any other feedback?
@christian-bromann in the RFC 8610 I see that |
That's my reading as well. A group choice like A // B is not "a kind of" group, it is a group and can be used wherever a group can be used. On top of the grammar, the CDDL spec notes that equivalence between a group and a list of group choices in section 2.1.2 which defines the syntax of groups:
That same section clarifies that parentheses are optional:
Also see section 2.1.1 that clarifies that inline definitions of groups are doable:
|
Side note: @christian-bromann, your RFC8610 quotes don't seem to match the contents of the published RFC. For example, section 3.9 is not group to group composition, I don't see the text you mention in the RFC, and the grammar terms and definitions are different. Could the text you quoted come from a previous draft, perhaps? And could that explain why we read things differently? |
As we have established in similar PRs, group choices can only be done with groups, not maps.
This is similar to other places in the spec, e.g.:
BrowserCommand
BrowsingContextCommand
BrowsingContextEvent
Preview | Diff