Publish swagger file through API

Instead of importing swagger file through SmartDocs in dev portal, then publishing and rendering, is there any other better way for publishing APIs ?

Can we define some API proxy, where we can post all swagger contents, then publish and render automatically?

I do not mean:

  • uploading an API specification. I know there's a management API for that. (model)
  • generating HTML.

I mean, once swagger docs are uploaded to DEV PORTAL, there is process of rendering and publishing them. Can we do that "Rendering and Publishing" part through an API call?

Thanks,

0 9 1,479
9 REPLIES 9

Former Community Member
Not applicable

@NiteshShrestha Is this a Duplicate? Please see this question.

(Edit: no, not a duplicate. I see this is a distinct question.)

Not applicable

@NiteshShrestha

For uploading APIs into Drupal, This link contains a tutorial along with a Postman collection. https://community.apigee.com/questions/4449/are-there-any-management-apis-for-smartdocs-can-i.html

Regarding rendering and publishing SmartDocs nodes:

Only out of the box core features are accessible via APIs. SmartDocs is a custom feature on top of core Drupal in the Apigee Edge devportal distribution, and is not (yet?) available via APIs. It could theoretically be APIfied with a custom module, yet to be written.

Thanks @Srinandan Sridhar and @Diego Zuluaga for guidence. I am able to upload apis in dev portal. Can we also render and publish through api ?

@Diego Zuluaga, I do not mean to generate HTML. I mean, once swagger docs are uploaded to DEV PORTAL, there is process of rendering and publishing them. Can we do that "Rendering and Publishing" part through API as well?

I see what you mean. It may be possible. My assumption is that all actions in Drupal are accessible through Drupal RESTful API. I was checking some resources online and that seems to be the case. Check this out https://www.drupal.org/project/restful.

@Anil Sagar any ideas here?

@Diego Zuluaga , Only out of the box core features are accessible via APIs. Smartdocs is a custom feature on top of core drupal in Apigee Distro. It can be APIfied with a custom module. I am sure, many will love it. Just need to find out time to write that module. @Dino , @Chris Novak , @Daniel Johnson What do you think about same ?

Yes - the Drupal Services module can allow this function to be API-fied!

I searched and found this video that describes how it would be possible. We can define our own functions that can respond to inbound API requests. That interesting bit starts around 37:00 .

It is not possible to do this out of the box, but it should be possible for Apigee to add this function to the Drupal devportal.

@Anil Sagar FYI

Not applicable

@Anil Sagar , @Dino, @Chris Novak, @Daniel Johnson This thread is about a year old, do you know if any progress has been made? We too are looking for this functionality in order to automate the process of publishing API documentation to the developer portal.

Thanks!