vscode-restclient
vscode-restclient copied to clipboard
Import requests document from postman collection.
As in the topic, I've created implementation to automatically import postman collection to the vscode by creating virtual document with HTTP requests within it exactly in a postman format. Currently unsupported:
- authorization-specific settings from postman collection.
I wanted to share it with you early so you can give me your feedback. I want to restructure this code soon. I want to create a resolver class that will be the factory for the option-specific importers.
Next steps:
- https://github.com/postmanlabs/openapi-to-postman to convert OpenAPI documents to the postman collection and using the existing importer, that I've already created, convert to rest-client document.
- https://github.com/postmanlabs/swagger2-postman2 - the same but with swagger... etc.
Anyway - if we make good work there then we can receive really nice way to import many things using the good stuff that postmanlabs team delivers. The license is an apache 2.0 so I don't know if that is a problem or not..
Demo:
This pull request introduces 1 alert when merging ed46bea57d936ffa0329ec0c1b57b4d57864719c into 2606ed6d7ab078ccf2bd93e94353b0c22fce1379 - view on LGTM.com
new alerts:
- 1 for Expression has no effect
Refactored the code to be easier to read and only authorization settings parser left.
This pull request introduces 2 alerts when merging 96c05ac886212261e161e96f2fac0b7d51f9f381 into 9f5412e785aeaa8648e427c0d05cc54111117cd4 - view on LGTM.com
new alerts:
- 1 for Unreachable statement
- 1 for Expression has no effect
Update: I made authorization parsing but it's not tested yet (It is tested but not for the request that has it's own authorization within a group(folder) that has another one) and the code is a bit rusty. Work to do:
- Test authorization parsing (within request, group, document)
- Refactor code within authorization parser.
- Add documentation about importing in readme.md.
Did you ever manage to complete this feature @rafek1241 ?
@ArmindoMaurits Unfortunately no, but the feature is there, as you see. Feel free to continue this if you want. If you want, you can build extension from this branch and it will work for most scenarios for postman collections