Configure your portal to define how to display your list of APIs.
By default, all APIs in the portal are displayed in alphabetical order. You can create a list that allows you to sort and group them.
About this task
- In your API Portal repository, open the config.toml file.
Enter your configuration at the end of the file, under
[params].The file contains comments with an example of the structure. The list should be structured as follows:
[params] [[params.api-list]] "<group_1>" = [ "<api_1>", "<api_2>" ] [[params.api-list]] "<group_2>" = [ "<api_3>", "<api_4>" ] [[params.api-list]] "default" = [ "<api_5>", "<api_6>" ]You can add as many groups as needed. You can also sort APIs in
"default"if they should appear at the beginning of the list, without a specific group.
The APIs should be referenced using the name of their folder in apis. Group names can contain UTF-8 and Unicode characters.Note: Once the list is created in config.toml, new APIs need to be added to it in order to appear in the portal.
- Commit your changes.
Once your portal is deployed with this new configuration, your APIs appear in the specified groups.
With the following configuration, the list would be displayed as in the image below:
[params] [[params.api-list]] "Inventory" = [ "books", "dvds" ] [[params.api-list]] "Sales" = [ "customers", "orders" ] [[params.api-list]] "default" = [ "employees"]