You are here

README.txt in Swagger UI Field Formatter 7

Same filename and directory in other branches
  1. 8 README.txt
  2. 7.2 README.txt
Swagger UI Field Formatter
==========================

Introduction
============

This module provides a field formatter for file fields with allowed file types
as json or yml, which renders the uploaded json or yml file using the Swagger UI
if the uploaded json or yml file is a valid swagger file. This module uses the
Swagger UI Library available at https://github.com/swagger-api/swagger-ui

Requirements
============
This module does not have any special requirements. However in order to be able
to allow json or yml file extensions in Drupal, you might need to install the
file entity module.

Installation
============
Download the module from https://drupal.org and extract it into your
sites/all/modules/contrib. Login as adminstrator and got admin/modules and select
Swagger UI Field Formatter and Save the configuration.

Configuration
=============

Goto admin/structure/types/manage/<type>/fields and add a new field of type file
and select the widget as file.
In the allowed extensions field in the field settings add yml,json.
After saving the new field settings Goto admin/structure/types/manage/<type>/display
select Swagger UI Formatter from the Format drop down for the newly created file
field.

Create a new content of the type <type> to which we added the new file field above
and upload a valid swagger .yml or .json file.
You can see that the uploaded swagger file is rendered using the Swagger UI.

File

README.txt
View source
  1. Swagger UI Field Formatter
  2. ==========================
  3. Introduction
  4. ============
  5. This module provides a field formatter for file fields with allowed file types
  6. as json or yml, which renders the uploaded json or yml file using the Swagger UI
  7. if the uploaded json or yml file is a valid swagger file. This module uses the
  8. Swagger UI Library available at https://github.com/swagger-api/swagger-ui
  9. Requirements
  10. ============
  11. This module does not have any special requirements. However in order to be able
  12. to allow json or yml file extensions in Drupal, you might need to install the
  13. file entity module.
  14. Installation
  15. ============
  16. Download the module from https://drupal.org and extract it into your
  17. sites/all/modules/contrib. Login as adminstrator and got admin/modules and select
  18. Swagger UI Field Formatter and Save the configuration.
  19. Configuration
  20. =============
  21. Goto admin/structure/types/manage//fields and add a new field of type file
  22. and select the widget as file.
  23. In the allowed extensions field in the field settings add yml,json.
  24. After saving the new field settings Goto admin/structure/types/manage//display
  25. select Swagger UI Formatter from the Format drop down for the newly created file
  26. field.
  27. Create a new content of the type to which we added the new file field above
  28. and upload a valid swagger .yml or .json file.
  29. You can see that the uploaded swagger file is rendered using the Swagger UI.