mulesoft / api-console

An interactive REST console based on RAML/OAS files
Other
911 stars 236 forks source link

`baseUri` property to replace RAML's base URI #535

Closed jarrodek closed 7 years ago

jarrodek commented 7 years ago

There's a lot of questions around this and few use cases to support in the console.

Currently setting the baseUri property on the API console affects the URL editor by providing it with additional information how to treat relative URLs in RAML. This should have wider support in the console.

In cases where the console can be used in different environments at the same time (for example changing base domain between staging, development and production) currently you have to build 3 different consoles for 3 APIs with corresponding base URIs. This is unnecessary and the console should be configurable to support this.

This ticket is to change behavior of the baseUri configuration property of the console.

New behavior

When the baseUri changes to any value (it will not check for valid of absolute URIs) the console passes the information to request editor. Request editor computes new URL value for url and url parameters editors. Both editors will accept new value and treat it the information it came from RAML. Any updates to the url in the URL editor or in the URL parameters editor will result with the URL with new base URI. If previous base URI contained variables the variables won't be applied to the URL (will be ignored).

When the baseUri property is cleared (empty, false, undefined, null) then the URL will be computed as it should be from the RAML definition.

This is scheduled for the beginning of next week. However comments are welcome.

upendrathakur commented 4 years ago

@jarrodek Can you please share any sample where I can override RAML baseUri in my mule app?

jarrodek commented 4 years ago

Hi, This is a repository for API Console and you are asking about integration with APIKit (used Anypoint Studio). Unfortunately I know very little about that. Maybe @pangelani can help with that?