2018-10-29 08-31-03
João Marques
mvp_badge
MVP
Allow hyphen ("-") in URL path of an exposed API Web Method
2013
Views
18
Comments
Implemented
Data & Integrations
Development Environment 11.14.4 (Build 57245)

In an Outsystems project we find ourselves building in an application in the middle of a landscape where communication with web services is not always there. This situation makes it very difficult to test a complete flow since dependencies of other systems are quite often down.

In order to surpass this situation making the application more independent for testing purposes, the idea is to try to have a module with a mock of those services and just changing the entry point on DEV / TST environment to make it work.

The problem is the external parties' web services have hyphens ("-") on the URL path of the web methods and when we are creating the mock service to expose, Service Studio considers the "-" an illegal character.

ScreenShot.png
Changed the category to
Integration

Move to Integration

2017-07-05 12-29-36
Carlos Alfaro
mvp_badge
MVP
Merged this idea with 'Expand the current available characters for REST API URL paths' (created on 08 Oct 2018 21:06:47 by David Sousa)
2022-05-19 09-39-13
David Sousa
Champion

At the moment we can't use certain characters in REST APIs URL paths, such as the character "-"


This idea's purpose is to include characters such as "-" in the list of valid URI characters



This comment was:
- originally posted on idea 'Expand the current available characters for REST API URL paths' (created on 08 Oct 2018 by David Sousa)
- merged to idea 'Allow hyphen ("-") in URL path of an exposed API Web Method' on 11 Oct 2018 08:24:54 by Carlos Alfaro
Changed the category to
Integration


This comment was:
- originally posted on idea 'Expand the current available characters for REST API URL paths' (created on 08 Oct 2018 by David Sousa)
- merged to idea 'Allow hyphen ("-") in URL path of an exposed API Web Method' on 11 Oct 2018 08:24:54 by Carlos Alfaro
2018-10-29 08-31-03
João Marques
mvp_badge
MVP

Isn't this the duplicate of this idea ?



This comment was:
- originally posted on idea 'Expand the current available characters for REST API URL paths' (created on 08 Oct 2018 by David Sousa)
- merged to idea 'Allow hyphen ("-") in URL path of an exposed API Web Method' on 11 Oct 2018 08:24:54 by Carlos Alfaro
Changed the status to
Not right now

Hi João Marques,

Thanks for bringing this to our attention.

Unfortunately we are not considering this functionality at the moment.

Thanks,


I am updating this idea to hopefully get the additional motivation to move this idea from "Not right now" to "Working on it".

Please advise If a new idea is needed.

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.

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. 


2018-10-29 08-31-03
João Marques
mvp_badge
MVP

Hi Ouen,


I think it is clear that it is a limitation.

The workaround I have seen for this situations is having a Service manager (and with it a new license the final customer has to pay) in between OutSystems and the caller doing the translation. It does not make sense to have to do this but it was the workaround I have seen in place for this situation and also for the PATCH limitation.


Being that said, I also would like to think OutSystems would reconsider the non-development of this limitation.


Cheers,

João 

Hi João ,


That option does make sense for an on-premise installation of the platform.

Do you have any recommendations or ideas for a similar solution on the OutSystems Cloud-hosted platform?


Thanks
Ouen

2018-10-29 08-31-03
João Marques
mvp_badge
MVP

Hi Ouen,


The solution I mentioned would still work on the OutSystems Cloud, you would need to have the API manager hosted somewhere else indeed (in a server on-premise or in the API manager cloud, this would depend on the API manager).


Basically you would need to select an API manager (e.g. API Gee), set it up and set up a service with a name with the "-" which then forward this to the correspondent in OutSystems without the "-". The API manager service (with the "-") will be the entrypoint for the external world.


As I mentioned, this was a workaround applied in a previous experience but of course customers are not eager to take the costs of another server and another license to workaround this OutSystems limitation.


Best regards,

João Marques

Hi guys,


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:




I also think this should definitely be addressed by outsystems.

Merged this idea with 'Add hyphen ("-") to the URL path' (created on 13 Jul 2018 11:26:04 by Prakash Behera)

Add hyphen ("-") to the URL path


We're facing an issue when trying to define an URL Path with the hyphen (-) character. Service Studio indicates that there are invalid characters in the URL Path. SO please add hyphen("-") in the URL path. 



This comment was:
- originally posted on idea 'Add hyphen ("-") to the URL path' (created on 13 Jul 2018 by Prakash Behera)
- merged to idea 'Allow hyphen ("-") in URL path of an exposed API Web Method' on 07 Sep 2020 10:52:04 by Fernando Moitinho

Hi Prakash,

Can you detail a little bit more? Where are you setting this URL Path?



This comment was:
- originally posted on idea 'Add hyphen ("-") to the URL path' (created on 13 Jul 2018 by Prakash Behera)
- merged to idea 'Allow hyphen ("-") in URL path of an exposed API Web Method' on 07 Sep 2020 10:52:04 by Fernando Moitinho
2019-11-12 17-31-26
Justin James
mvp_badge
MVP

Why is this put under "Ideas"? This should either be a support ticket or a forum post. This isn't an "Idea".

J.Ja



This comment was:
- originally posted on idea 'Add hyphen ("-") to the URL path' (created on 13 Jul 2018 by Prakash Behera)
- merged to idea 'Allow hyphen ("-") in URL path of an exposed API Web Method' on 07 Sep 2020 10:52:04 by Fernando Moitinho
Changed the category to
Frontend


This comment was:
- originally posted on idea 'Add hyphen ("-") to the URL path' (created on 13 Jul 2018 by Prakash Behera)
- merged to idea 'Allow hyphen ("-") in URL path of an exposed API Web Method' on 07 Sep 2020 10:52:04 by Fernando Moitinho

We had a support ticket for the same. CaseId=2069974


This was our  question to support team.


We're developing an exposed REST API in OutSystems that needs to have the same contract (same URL Path, request, response, etc) as another existing REST API developed with another technology.


We're facing an issue when trying to define an URL Path with the hyphen (-) character. Service Studio indicates that there are invalid characters in the URL Path.


Why can't we define an URL Path with the hyphen character? Is this the expected behavior? If so, can you point us to some documentation referencing why some characters aren't allowed?



This comment was:
- originally posted on idea 'Add hyphen ("-") to the URL path' (created on 13 Jul 2018 by Prakash Behera)
- merged to idea 'Allow hyphen ("-") in URL path of an exposed API Web Method' on 07 Sep 2020 10:52:04 by Fernando Moitinho
Changed the category to
Integration


This comment was:
- originally posted on idea 'Add hyphen ("-") to the URL path' (created on 13 Jul 2018 by Prakash Behera)
- merged to idea 'Allow hyphen ("-") in URL path of an exposed API Web Method' on 07 Sep 2020 10:52:04 by Fernando Moitinho
Changed the status to
Implemented
on 17 Jan 2022

Hi João,

I'm glad to announce that this capability is now available in Service Studio. Thanks for bringing this to our attention. 

Please continue providing feedback.

Thanks,