Hi All,
Just spent a frustrating hour finding out why a consumed REST api would not work. Thought i'd share the outcome here.
We are consuming a restservice that looks pretty well designed.
All of the methods contain headers... Some with hyphens in the name. E.g.:
X-request-id
requester-id
THe parameter names resolve to Xrequestid and requesterid. These have a "name in request" set because the "send in" Header allows this, so they get sent correctly:
A few of the methods contain body's (POST) with hyphens in parameter names. E.g.:
This goes well because the request format is set to JSON and JSON allows this as well:
A few of the methods contain URL parameters with hyphens in the name. They don't work. the hyphens get removed from the parameter name and the "send in" URL option does not have something like "name in URL" where you can tell outsystems to put the hyphen back. I think this comes close to: https://www.outsystems.com/ideas/5205/allow-hyphen-in-url-path-of-an-exposed-api-web-method/ but this is for a consumed rest API where i had to move heaven and earth to get the developers to change this. Not very useful as a solution for others experiencing this, but maybe useful if you're trying to figure out what goes wrong.....
A side-note on this. If you refresh the API:
You also get an overview (after importing the new / old swagger) where you can select the methods. All of the consumed methods showed up as "deleted" with a new one right above it. Of course because it did not recognise the url-path (which had the hyphen-parameters in it) from the last time it consumed it. It had removed the hyphens....
Happy programming!
Alexander Lange