Skip to content

Commit

Permalink
Re-order CDDL definitions so that Command / Message are first (#83)
Browse files Browse the repository at this point in the history
The first rule in a CDDL document defines the entry point to validate a CBOR
data item. The CDDL of each module started with `Extensible`, which essentially
made any CBOR data item valid.

This update makes `Command` and `Message` the first CDDL rules in each module
(as done in WebDriver BiDi), and defines `Extensible` is a single block common
to both the remote end and local end definitions.
  • Loading branch information
tidoust authored Dec 18, 2024
1 parent fdb685b commit 7cb6e57
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ This section gives the initial contents of the remote end definition and local e
[=Remote end definition=]

<xmp class="cddl remote-cddl">
Extensible = {
*text => any
}

Command = {
id: uint,
CommandData,
Expand All @@ -143,10 +139,6 @@ EmptyParams = { Extensible }
[=Local end definition=]:

<xmp class="cddl local-cddl">
Extensible = {
*text => any
}

Message = (
CommandResponse //
ErrorResponse //
Expand Down Expand Up @@ -185,6 +177,14 @@ EventData = (
)
</xmp>

[=Remote end definition=] and [=local end definition=]:

<xmp class="cddl remote-cddl local-cddl">
Extensible = {
*text => any
}
</xmp>

Capabilities {#protocol-capabilities}
-------------------------------------

Expand Down
8 changes: 4 additions & 4 deletions schemas/at-driver-local.cddl
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
Extensible = {
*text => any
}

Message = (
CommandResponse //
ErrorResponse //
Expand Down Expand Up @@ -39,6 +35,10 @@ EventData = (
InteractionEvent
)

Extensible = {
*text => any
}

SessionResult = (SessionNewResult)

CapabilitiesRequest = {
Expand Down
8 changes: 4 additions & 4 deletions schemas/at-driver-remote.cddl
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
Extensible = {
*text => any
}

Command = {
id: uint,
CommandData,
Expand All @@ -16,6 +12,10 @@ CommandData = (

EmptyParams = { Extensible }

Extensible = {
*text => any
}

SessionCommand = (SessionNewCommand)

CapabilitiesRequest = {
Expand Down

0 comments on commit 7cb6e57

Please sign in to comment.