w3c / automotive

W3C Automotive Working Group Specifications
Other
146 stars 68 forks source link

Filter request syntax simplification #409

Closed UlfBj closed 2 years ago

UlfBj commented 3 years ago

The filter expression currently consists of three key-value pairs as shown below. After feedback from a client implementer that this leads to long and hard to read requests, an analysis lead to that the expression can be simplified to two key-value pairs instead. Current: {"op-type":"", "op-value":"", "op-extra":{}} New proposal: {"type":"", "value":""}

Below follows an example of the current syntax, and the proposed syntax. Current: {"action":"subscribe","path":"Vehicle/Cabin/Door/Row1/Right/IsOpen","filter":{"op-type":"capture","op-value":"time-based","op-extra":{"period":"3"}},"requestId":"246"} Proposed: {"action":"subscribe","path":"Vehicle/Cabin/Door/Row1/Right/IsOpen","filter":{"type":"time-based","value":{"period":"3"}},"requestId":"246"}

crea7or commented 3 years ago

a good idea, just realized that metadata requests too complex and can be changed to:

"filter": {
 "type": "static-metadata", 
 "value": ["prop1", "prop2"]
}

"filter": {
 "type": "dynamic-metadata", 
 "value": ["prop1", "prop2"]
}
wonsuk73 commented 3 years ago

Basically I agreed with the proposal from @UlfBj. In specific there are two filter functions which use a "op-extra" property like capture and metadata filter. 1) Regarding metadata filter function, I support @crea7or's proposal. 2) Regarding capture filter function, I would like to suggest names of the type as below to make clear the type's meaning.

UlfBj commented 2 years ago

Fixed in PR418