rsmp-nordic / rsmp_validator

Official RSMP Nordic automated test tool, build with Ruby and Rpec.
https://rsmp-nordic.github.io/rsmp_validator/
MIT License
4 stars 2 forks source link

ITC-3 uses empty strings instead of null for functionalPosition and functionalState #435

Open emiltin opened 2 months ago

emiltin commented 2 months ago

Accoding to the SXL spec, functionalPosition and functionalState are unused and should be set to null in the AggregatedStatus. https://rsmp-nordic.github.io/rsmp_sxl_traffic_lights/1.2.1/sxl_traffic_light_controller.html?highlight=null#aggregated-status

But the ITC-3 instead sets them to empty strings "":

    2024-09-10T22:15:34.956Z  47024  AA+BBCCC=DDD         AA+BBCCC=DDDEEFFF    08ed  Received AggregatedStatus status for component AA+BBCCC=DDDEEFFF [low_priority_alarm, normal]  {
    "mType": "rSMsg",
    "type": "AggregatedStatus",
    "mId": "08edbdab-7983-4cb2-8353-d0cd0b03e0c6",
    "ntsOId": "AA+BBCCC=DDDEEFFF",
    "xNId": "",
    "cId": "AA+BBCCC=DDDEEFFF",
    "aSTS": "2024-09-10T22:15:34.772Z",
    "fP": "",
    "fS": "",
    "se": [
        false,
        false,
        false,
        false,
        true,
        true,
        false,
        false
    ]
}
sveitech commented 2 months ago

This has been fixed.

emiltin commented 2 months ago

You mean right now? It seems we're missing a test specifically for this, as "" is currently accept. Or @otterdahl would you rather modify the SXL to allow "" as well as null?

emiltin commented 2 months ago

From 1.1, the SXL states that the two attribute are unused and should be set to null.

In the RSMP schema files, the AggregatedStatus is defined as part of the core schema, and both string and null are allowed. This makes sense since in earlier SXLs what to send was nto really defined clearly, and the core schema cannot change depending on the SXL.

Adherence to the core schema is checked implicitely by json schema validation. If we want to check that null is used (rather than "") frm SXL 1.1. we should add a test specifically for that.

SwarcoPalm commented 2 months ago

You mean right now? It seems we're missing a test specifically for this, as "" is currently accept. Or @otterdahl would you rather modify the SXL to allow "" as well as null?

Yes it was fixed yesterday. Should be reflected in the validator on the test controller also