Enable Try it out feature for Apigee Drupal 8 Kickstart Portal

Hi @Dino-at-Google, @Jyothi K Reddy @marshg@google.com, @Will Witman @Anil Sagar @ Google

I am working on Drupal 8. I have installed the Apigee Kickstart Portal. It is working perfectly alright. I want the TRY IT feature enabled for the swagger doc so that developers can test the service.

How to enable it?

Any help would be appreciated, will be waiting for the reply.

Regards,

Ashwith

0 3 412
3 REPLIES 3

Hey @Ashwith G first setup swagger UI module by following the following steps, as described in the readme.

1. Install an enable the [Swagger UI Field Formatter](https://www.drupal.org/project/swagger_ui_formatter) module.

2. Install the Swagger UI JS library as documented [on the module page](https://www.drupal.org/project/swagger_ui_formatter).

You may choose to install it via composer too using, which will help you download the libraries as well.

composer require drupal/swagger_ui_formatter

3. Go to Configuration > API catalog > Manage display in the admin menu.

4. Change "OpenAPI specification" field format to use the Swagger UI field formatter.

Now you will see a small gear icon to the right of the 'Open API Specification field', Open the gear and choose the options you want as displayed here in the attached screenshot. (notice the try out support for HTTP methods). And now update and save config.

9285-swagger-ui-config.png

Hope that helps!

Hi @Jyothi K Reddy

After following the above-mentioned steps I see the following error

The website encountered an unexpected error. Please try again later.

Regards,

Ashwith

Hey!

Go to /admin/reports/status and check if swagger UI library is correctly installed or not.

Also please check admin/reports/dblog to see what the error is. This will help further in debugging the issue.