How to embed swagger editor to Drupal developer portal

swagger editor is an open source nodejs application. may I know how to integrate swagger editor with drupal developer portal? In this way, we provide end users swagger file online edit function. Smartdocs module only supports reading and parsing but not writing or creating.

0 5 922
5 REPLIES 5

Hi there

What is your use case/what types of users do you see visiting your developer portal to use a swagger editor?

The developer portal is where your developer community can discover your APIs, and learn how to use them through your documentation. ie you, as the publisher of the APIs would use such tools (swagger editor) to document and maintain your API Specifications, then generate smartdocs...

As an API publisher, it would be better if we have swagger editor to provide online edit/create function on developer portal. Sometimes we need to update or create swagger document on demand. It is not convenient to go through offline edit/update smartdocs/offline edit/update smartdocs/..... cycle.

Another requirement is to integrate swagger editor and smartdocs with source management tool such as git.

This module provides a field formatter for File and Link type fields which renders the referenced file using Swagger UI if the file is a valid Swagger file. Supported file types are JSON (.json) and/or YAML (.yml or .yaml).

https://www.drupal.org/project/swagger_ui_formatter

i work with it in both D7 & D8 in devportal

This is only provided provide the swagger UI capability not the editor part.

I've created one module to integrate swagger editor in Drupal 8 and published it on Github.

Let me know if it was helpful for you.

Here's the link:

https://github.com/amangrover90/apigee-swagger-editor