department-for-transport-public / D-TRO

Digital Traffic Regulation Orders (D-TRO)
MIT License
3 stars 1 forks source link

Publication issue with AccessConditionType condition #35

Closed janicki95 closed 1 week ago

janicki95 commented 1 week ago

When publishing a source that contains a "accessConditionType" condition, the service returns error code 500 with the following error:

{
    "message": "Internal Server Error",
    "error": "An unexpected error occurred: The JSON value could not be converted to System.Collections.Generic.List`1[System.String]. Path: $.accessConditionType | LineNumber: 0 | BytePositionInLine: 44."
}

"accessConditionType":

{
    "accessConditionType": "loadingAndUnloading",
    "negate": false
}
MehrajRM commented 1 week ago

Hi Patryk,

Please could you provide the full payload and the full command that you are using? Many thanks

stm-john-cooper commented 1 week ago

The square brackets are missing around the loadingAndUnloading. It should be:

{
    "accessConditionType": ["loadingAndUnloading"],
    "negate": false
}

I have successfully parsed my own customised version of your order into the INT environment with the above amendment.

stm-john-cooper commented 1 week ago

Closing as completed but let us know if any problems persist.

davidgruar commented 1 week ago

@stm-john-cooper I assume the square brackets in your example should go outside the quotes rather than inside? ["loadingAndUnloading"] not "[loadingAndUnloading]".

stm-john-cooper commented 1 week ago

Yes, correct. Sorry, should be:

                                                                                                                {
                                                            "accessConditionType": ["loadingAndUnloading"],
                                                            "negate": false
                                                        },
stm-john-cooper commented 1 week ago

Fixed in the above thread too - just in case others don't look this far down.