How to programmatically generate a collection from an openAPI / Swagger endpoint? - postman

Generating a Postman collection from an openAPI / Swagger documentation JSON file is already possible using the Postman API Client (a desktop app).
However, for purposes of programmatically modifying an existing collection using the NodeJs-based Postman SDK I'd like to be able to automate the process of generating a postman collection.
Whether that is via a command line tool (I haven't found any such tool), Postman API REST request (I haven't been able to find out how) or otherwise, does not really matter.
As long as it is possible to do without pressing a button in some app.
Is this possible at all?

Postman uses this module in the APP to convert from OpenAPI to a Postman Collection.
https://github.com/postmanlabs/OpenAPI-to-Postman
This should provide you with a programmatical way of doing this outside of the app.

Related

Expose the swagger generation route(s) in the swagger.json with Swashbuckle

I am trying to expose the routes which give back the swagger.json documents for an ASP.Net 6 web api, in the generated swagger.json itself.
I just need to see the swagger generation route used to generate the JSON document, alongside the other endpoints of my API.
I tried both app.UseSwagger and app.MapSwagger but the route template (containing the {documentName} token) never make its way to the Operations parsed by Swashbuckle.
How can I achieve this goal ?
Thx !

Hoppscotch APIs

I am looking out to see if any open apis are there to build hoppscotch Collection from the existing collection JSON.
I need to migrate the postman collection to Hoppscotch collection.
Hoppscotch is currently giving the option to upload postman collection JSON but I need an API to do the same.

WSO2 AM API DOCS - Is there a way to use swagger as API Documentation in DevPortal?

The company that i work for is developing an API to allow an integration with our applications. We're using WSO2 AM as our gateway. I hava to document the API and they want me to use WSO2 devportal to do so. But the problem is that they also wanna use Swagger to create this documentation. Is there a way to add Swagger in the API Docs?
One workaround would be, you can add document type of Markdown and add the swagger content as code.
So it can be viewed from Devportal as shown below:

How can I hide an API key in a GitHub public repo?

I am doing a simple front-end project where I (or a user) make an API call to the openweathermap api, fetch weather info and display it on a website.
Simple HTML, CSS and vanilla JS
So I want to keep the repo public & host the site with GitHub Pages... but my js file contains the API key which is required at runtime.
Extra Info:
(all this I found when I searched)
I know there is a way to keep an API key in a GitHub secret, then reference it in a yml file as an environmental variable in GitHub Actions.
But how can I put that secret in js code at runtime for any user who access my website?
Please note that what you're attempting to do is not secure. Even if there was a way to get GH Pages to inject the secret API key into the js file at the time of the request, every web client would then have a copy of that js file with the cleartext key embedded.
You will need some sort of minimal backend which stores the API key securely and relays calls from your static web page to the openweathermap API.
There are many ways to set up such a backend. The older question linked in the comments discusses some approaches. Note that nowadays, you could use a serverless FaaS service such as AWS Lambda or Azure Functions.
This is a perfectly valid question by the way and you're certainly not "too dumb". Good luck!

Testing RingCental APIs with Postman

The RingCentral API Explorer allows to select the app and start testing all the APIs, but what I prefer is testing the APIs with Postman as it is easier and flexible.
While I am testing the APIs with Postman clients, I was look if there are any ready-made Postman collection available which I can simply import and start testing the RingCentral APIs with minimum changes.
I haven't found any available collection for RingCentral APIs in the net. Is there any existing API Postman collection available which is been used by RingCentral developers and tester?
There are some postman collections available, but not sure if those are updated. However you can try these following importing to your Postman client:
https://github.com/grokify/ringcentral-postman
and
http://ringcentral.github.io/api-specs/specs_engage_engage-digital_postman-2.0.json
ref: https://developers.ringcentral.com/engage/digital/guide/postman
You can try importing into your postman and start testing, create different environment.
Alternately there is also Swagger 2.0 to Postman 2.0 converter which will convert Swagger collection to Postman.
You can find the reference and Swagger collection here:
https://community.ringcentral.com/questions/629/postman-collection.html
Navigate to the API reference page. It looks like this:
Fill out the information. In this example you'd add a person ID.
Click Try it out and follow the instructions.
The cURL command on the right will automatically update with your auth information.
Open Postman.
Click the Import button, located on top left corner.
Click the Raw Text tab.
Paste the generated cURL command in the text feild.
Postman will automatically generate the authorization headers and body. Once you do this once you can use it as a template for all other API's using Postman.