天天看点

How to resolve error message Malformed URI literal syntax

Description

When you are performing “read by guid” testing in OData request, you meet with the error message Malformed URI literal syntax .

How to resolve error message Malformed URI literal syntax

Keywords

Postman, OData test, read by guid, Malformed URI literal syntax, regular_expression

Root cause

For example, the url used:

https://ldciag3.wdf.jerry:44354/sap/opu/odata/sap/Z_C_ORDER_VIEW_CDS/Z_C_Order_View(order_guid=guid

’00163EA7-2000-1ED2-85EF-EFADF195A1B2’)

Note: you must add the prefix ‘guid’ before the guid value as naming convention.

Debug where this error message is raised, and we reach the framework code in line 22, where the validation is done based on the hard coded regular expression.

How to resolve error message Malformed URI literal syntax

Solution

The solution for line 22 is clear, change the guid in url into “00163EA7-2000-1ED2-85EF-EFADF195A1B2”, and the validation will pass.

继续阅读