You are here

README.txt in Swagger UI Field Formatter 7.2

Same filename and directory in other branches
  1. 8 README.txt
  2. 7 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/releases

Requirements
============

* Swagger UI Library https://github.com/swagger-api/swagger-ui/releases

* to be able to allow json or yml file extensions in Drupal, you might need to
  install the file entity module.

Installation
============

* Download the latest Swagger UI library from
  https://github.com/swagger-api/swagger-ui/releases

  Extract the content and place it inside the following directory:
  sites/all/libraries/swagger_ui

  Note: only the content of swagger_ui/dist folder and the swagger_ui/package.json
  file are required by this module. Files with .html extension in swagger_ui/dist/
  folder are unnecessary so they can be removed.

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

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

* Go to 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/releases
  9. Requirements
  10. ============
  11. * Swagger UI Library https://github.com/swagger-api/swagger-ui/releases
  12. * to be able to allow json or yml file extensions in Drupal, you might need to
  13. install the file entity module.
  14. Installation
  15. ============
  16. * Download the latest Swagger UI library from
  17. https://github.com/swagger-api/swagger-ui/releases
  18. Extract the content and place it inside the following directory:
  19. sites/all/libraries/swagger_ui
  20. Note: only the content of swagger_ui/dist folder and the swagger_ui/package.json
  21. file are required by this module. Files with .html extension in swagger_ui/dist/
  22. folder are unnecessary so they can be removed.
  23. * Download the Swagger UI Field Formatter module from https://drupal.org and extract
  24. it into your sites/all/modules/contrib. Login as administrator and got admin/modules
  25. and select Swagger UI Field Formatter and Save the configuration.
  26. Configuration
  27. =============
  28. * Go to admin/structure/types/manage//fields and add a new field of type file
  29. and select the widget as file.
  30. In the allowed extensions field in the field settings add yml,json.
  31. After saving the new field settings Goto admin/structure/types/manage//display
  32. select Swagger UI Formatter from the Format drop down for the newly created file
  33. field.
  34. * Create a new content of the type to which we added the new file field above
  35. and upload a valid swagger .yml or .json file.
  36. You can see that the uploaded swagger file is rendered using the Swagger UI.