Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Customizing Smart Docs Summary Page

I am attempting to replace the smart docs summary with a Swagger UI. I am in the process of adding the Drupal module https://www.drupal.org/project/swagger_ui_formatter to replace the smartdocs method listing.

The module creates a format field type called Swagger UI Formatter which renders the smart doc as seen below.

The Swagger UI Formatter field works within a node, however I'm trying to get it to render from a view (eventually the base view). After inserting that field type in the view, it breaks the view completely and makes it un-editable and makes it impossible to grab the PHP code in order to update the base view.

If any of the Drupal experts have any ideas on implementing the Swagger UI Formatter into the base view for smart docs it would be GREATLY appreciated.

@Anil Sagar
@Gitesh Koli

@Daniel Johnson


4429-smart-docs-view.png

4427-smart-docs-resource-summary.png

Solved Solved
0 6 629
1 ACCEPTED SOLUTION

Not applicable

@Dave: We have recently started playing with this module. I think it will take a bit more polish to get it into a production-ready state, but I think this is a good prospective alternative to the SmartDocs module, which can sometimes have performance issues for some customers.

One interesting difference between this module and SmartDocs is that the Swagger UI Formatter embeds a complete model in a single node, whereas SmartDocs creates a single node for each method within the model.

I'll try to take a look at embedding these fields in a view later this week. I'm curious: what's your use-case for embedding these in a view?

Also, I'm curious to hear how (if at all) you have gotten security models to work. I haven't fully explored them but I have heard through the grapevine that this module doesn't fully support them to the same degree that the Swagger UI on swagger.io does. This is an area which I have been planning on exploring when I get a few spare moments.

View solution in original post

6 REPLIES 6