function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AbAb 

Using a swagger in postman | extenson .yml

Hello,

I have swagger of extension .yml
How can i import it in Postaman and test it ?

Thank you for suggestions
Best Answer chosen by Ab
Khan AnasKhan Anas (Salesforce Developers) 
Hi Sandrine,

Greetings to you!
 
  • Click on Import -> "Choose Files"
  • Browse to the Swagger doc (swagger.yaml)
  • After selecting the file, a new collection gets created in POSTMAN. It will contain folders based on your endpoints.

In Swagger 2.0 the info field is mandatory. Just add the following to your YAML root:
info:
  title: 'EmptyTitle'
  description: 'EmptyDescription'
  version: 0.1.0

Also, convert Swagger v2 to Postman v2: https://www.npmjs.com/package/swagger2-postman2-converter

Please refer to below links:

https://github.com/postmanlabs/postman-app-support/issues/2857

https://stackoverflow.com/questions/39072216/how-to-export-swagger-apis-into-postman

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

All Answers

Amit Chaudhary 8Amit Chaudhary 8
  1. Click on the 'Import' button in the top left corner of Postman UI.
  2. You will see multiple options to import the API doc. Click on the 'Paste Raw Text'.
  3. Paste the JSON format in the text area and click import.
  4. You will see all your APIs as 'Postman Collection' and can use it from the Postman.
Please check below post
1) https://stackoverflow.com/questions/39072216/how-to-export-swagger-apis-into-postman
2) http://blog.getpostman.com/2018/03/02/sync-your-specs/
3) https://www.getpostman.com/docs/v6/postman/collections/data_formats

Let us know if this will help you
 
Khan AnasKhan Anas (Salesforce Developers) 
Hi Sandrine,

Greetings to you!
 
  • Click on Import -> "Choose Files"
  • Browse to the Swagger doc (swagger.yaml)
  • After selecting the file, a new collection gets created in POSTMAN. It will contain folders based on your endpoints.

In Swagger 2.0 the info field is mandatory. Just add the following to your YAML root:
info:
  title: 'EmptyTitle'
  description: 'EmptyDescription'
  version: 0.1.0

Also, convert Swagger v2 to Postman v2: https://www.npmjs.com/package/swagger2-postman2-converter

Please refer to below links:

https://github.com/postmanlabs/postman-app-support/issues/2857

https://stackoverflow.com/questions/39072216/how-to-export-swagger-apis-into-postman

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
This was selected as the best answer