Configure the module
Last updated on
12 April 2019
Configure the Swagger UI Field Formatter module by adding a new File or (since version 8.x-2.2) a Link type field to a content type such as Basic page.
Configuration for File type fields:
- Navigate to Structure > Content types > TYPE > Manage fields.
Where TYPE is the content type to which you want to add the new field, such as a Basic page. - Click on the Add field button to add a new field.
- Set the field type to File and enter a label name.
- Click Save and continue.
- On the Edit tab, in the Allowed file extensions field enter the following: yaml,yml,json
- Click Save settings.
- Click on the Manage display tab.
- Select Swagger UI in the Format drop-down for the new field.
- To configure the field formatter click in the field row.
- Click Save.
- Add a new TYPE type content and upload a valid Swagger file.
Configuration for Link type fields:
- Navigate to Structure > Content types > TYPE > Manage fields.
Where TYPE is the content type to which you want to add the new field, such as a Basic page. - Click on the Add field button to add a new field.
- Set the field type to Link and enter a label name.
- Click Save and continue.
- On the Edit tab manage your field settings as you wish.
- Click Save settings.
- Click on the Manage display tab.
- Select Swagger UI in the Format drop-down for the new field.
- To configure the field formatter click in the field row.
- Click Save.
-
Add a new TYPE type content and provide a valid Swagger file path.
When viewing the page, the uploaded Swagger file will be rendered using the Swagger UI.
Note: If the content does not render correctly, try clearing the cache by navigating to Configuration > Development > Performance and clicking Clear all caches.
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion