33
Views
4
Comments
Solved
URL Path customisation error on exposed REST API method
Question

The following error is generated in ServiceStudio (v11.8.4 Build 25053) when a hyphen (-) is used in the custom `URL Path` property of an exposed REST method.

Invalid URL Path
 Invalid URL characters in property 'URL Path' of the 'CustomURLPath_GET' REST API method.


Is this behaviour correct or a potential bug?

There is no detail on the Invalid URL Path Error page for this error and this use case is not covered in the Customize REST URLs page.

My view is that the hyphen should not cause an issue in the `URL Path` based on the subsequent ramble.

The `URL Path` property is a "Customized URL for the method. Use it in order to follow RESTful principles identified by your organization.".

An HTTP URL takes the form:

      http://<host>:<port>/<path>?<searchpart>

It is my understanding that the ServiceStudio `URL Path` property relates to the /<path> component.

Within the /<path> component, "/", ";", "?" are reserved. 

The "/" character may be used within HTTP to designate a hierarchical structure.

The "{" and "}" are used in the ServiceStudio `URL Path` property to designate an input variable to the method.

The "-" is a restricted character in ServiceStudio for `Name` properties.

Therefore, the hyphen should not break `URL Path` property. 

Thanks
Ouen
Rank: #304
Solution

OutSystems support has confirmed that the REST URL Path is a limitation of Service Studio and that the limitation is not described in the documentation.

The situation has already been reported to the R&D team in order to review the documentation and add all the URL Path constraints in Service Studio. 

Based on the use case that I presented to support they reported this improvement suggestion to the R&D teams for further evaluation.

There is an idea that I have updated and you encouraged to go and like it to add more motivation to get the situation resolved.

https://www.outsystems.com/ideas/5205/allow-hyphen-in-url-path-of-an-exposed-api-web-method

mvp_badge
MVP
Rank: #2

Hi Ouen,

Be sure to also report this to OutSystems Support.

Rank: #304
Solution

OutSystems support has confirmed that the REST URL Path is a limitation of Service Studio and that the limitation is not described in the documentation.

The situation has already been reported to the R&D team in order to review the documentation and add all the URL Path constraints in Service Studio. 

Based on the use case that I presented to support they reported this improvement suggestion to the R&D teams for further evaluation.

There is an idea that I have updated and you encouraged to go and like it to add more motivation to get the situation resolved.

https://www.outsystems.com/ideas/5205/allow-hyphen-in-url-path-of-an-exposed-api-web-method

mvp_badge
MVP
Rank: #2

Thanks for reporting back. It's indeed a strange situation...

Rank: #892

Hi Ouen, 

I described a possible workaround on the ideas forum, but its probably better to describe it here in case its helpful:

"I was thinking about this, and another option could be to inject the hyphen as an url parameter, when creating the mock. 

This is probably only useful for the test scenario, unless there's some way to sanitize the input before the request - but it can potentially be a workaround without the need for an external service. 

The endpoint will work with the hyphen, but also with a full encyclopedia text :D

The following responds to /hyphen-test, the input parameter is of type text:"


Alas, we can obviously check the parameter to meet the requirement:


Again, I can not see this being put to use outside testing environments - documentation will be published with this parameter, and its just weird, so I hope they fix it.


Regards,

Nuno