joolfe / postman-to-openapi

🛸 Convert postman collection to OpenAPI
MIT License
605 stars 105 forks source link

feat: allow javascript object as input and output #174

Closed codeasashu closed 2 years ago

codeasashu commented 2 years ago

I wanted this to integrate this awesome tool into my browser based react application.

Everything I wanted is usable in a browser except fs, which I don't really need in my case.

Hence this fixes the hard requirement of fs. Only depend on fs if someone is interested in reading or writing files

codeasashu commented 2 years ago

@joolfe Kindly approve

codeasashu commented 2 years ago

@joolfe I am using this awesome library in one of my JS project https://github.com/codeasashu/react-openapi-designer

I am allowing users to copy paste a json string and maintaining it as JS object. In my case, it is easier this way since it is a SPA and this project will help a lot

codeasashu commented 2 years ago

@joolfe The other reason is simply that in my JS project, I can't use file upload (it is a SPA). Hence, I am depending on FileReader API to read the file contents, which gives me JSON object.

Again, it is better this way that it should be able to support both the file and the string. It's an enhancement

joolfe commented 2 years ago

I will take into consideration as feature but cannot accept this merge as it doesn't contain any unit test neither for the library or for the cli...

codeasashu commented 2 years ago

@joolfe Thanks for consideration. Please do not close this MR as I will be adding tests soon

michael-land commented 2 years ago

my use case would be pipe raw json output to jq cli tool to do some sort of transformation.

joolfe commented 2 years ago

Merged and reverted by error, but i will keep in mind.