How to display API description field that is present in Swagger file to Smartdocs in Developer Portal

Not applicable

Hi,

I have to display the API description present in the swagger file on the Smartdoc model. I am able to display the description for the methods of that API but not the common description that appears in the beginning of the Swagger file under the info part.

Kindly help.

0 5 748
5 REPLIES 5

Not applicable

As far as I can see none of the overarching API information is imported when the swagger is processed. You only get the operation documentation. From my perspective it would make sense to be able to import a swagger file and the global part becomes the Smartdocs model and the operations become Smartdocs methods.

You could look at using Dev Portal APIs to create a model based on the top level API swagger documentation and then import the swagger document into that model to get the operations. I have prototyped the basic calls for this using a module from Apigee called Smartdocs Service.

@Rashmi Rajkumar , You can able to do that,

This custom module should solve your problem. Using above module, You can retrieve all the information in original uploaded swagger spec & use that to render any information present in original spec.

You need to update the template file & use the javascript object that contains original spec to display information you need in SmartDocs page.

Hope it helps.

@Anil Sagar I can see there are a number of custome modules arounf that add / modify behaviour. What is the Apigee strategy for these ? Are these early versions of upcoming produc features? Are they maintained / updated regulalrly ?

@mark.ferguson , Custom modules are support through community only. Custom module maintenance / update should be again through open source & community. Unfortunately, I am not sure when above features will be integrated into product.

@marshg@google.com , Might know more about same.

@Anil Sagar

We have uploaded your custom module and enabled it. We are able to get the value of API description on portal page but we are unable to display the same in smartdoc template because smartdoc template does not support PHP.

Please help us with the same.