Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Swagger-based interactive documentation allows you to try out APIs from the documentation itself. It is a Java Script client that runs in the API Store and makes Java Script calls from the Store to the API Gateway. Since the API Store and Gateway run on two different ports, you must enable cross-origin resource sharing (CROSCORS) between the two using CORS configuration in <APIM_HOME>/repository/conf/api-manager.xml file. Given below is a sample configuration of CROS CORS and a description of its XML elements:

...

  1. In the API Publisher, go to the Doc tab of FindFeeds API to see its API definition. Click Edit Content.
  2. API definition contains the JSON representation of the API. You can easily modify existing content, add/remove elements, change paths and parameters etc. using the JSON editor.

    Info
  3. There are Two ways to modify the API Defnition. You can either use the Text Editor given, or the graphical tree editor.

    By default, all the POST and PUT operations have the Payload parameter, which you can use to send any payload when invoking the API. The GET, DELETE operations have Query parameters, which you can use to send URL-appended parameters (ex: v=2&length=200). You can also add named parameters. For example, to modify the path of the API created above with a parameter, edit the path and add the relevant parameter.

    Let's say that you want to send a query parameter called 'v' in the GET request of top_rated resource. The screenshot below shows path modified with a parameter. Also, the default Query Parameter is changed to a parameter called v .

    Text Editor

    You can just modify the JSON content according to Swagger Specification.

    Graphical Editor

    If you would like to use Shown below is an example of the graphical editor here is the way to do. To add new elements, click Add New Value and provide the value. To delete elements, delete the value of Key. For example, if you delete the Key value named description, that element will be deleted.  

    Image Removed

    Also be sure to modify descriptions, notes, summary on each of the operations.

    Image Added

     

  4. Once the modifications are done, save.

  5. Log in to the API Store and click on GET operation to expand it. There you can enter the parameters and try it out.
    Image Removed Image Added

Next, see API Versioning.