joolfe / postman-to-openapi

🛸 Convert postman collection to OpenAPI
MIT License
575 stars 99 forks source link

SyntaxError: Unexpected end of JSON input when converting backed up collection #175

Closed alexwebgr closed 2 years ago

alexwebgr commented 2 years ago

i noticed a rather peculiar behaviour

when i export a collection manually from postman and convert it with p2o it works just fine coupled with redoc is a match made in heaven. although it would be great if the disabled params would show up as well.

In postman i have enabled the github integration so that the collection is automatically pushed to a repo every time is saved

when i pull the collection from the repo i try to convert it i get this error SyntaxError: Unexpected end of JSON input

the json is valid and collection is valid i even tried converting with some other tools like this one and they can convert it just fine

i like this one better because it also maintains all the examples

thanks alex

alessandro-candon commented 2 years ago

I have the same issue as you...

joolfe commented 2 years ago

Hi @alexwebgr,

Could you please attach the collection that is getting the error? I will review what is exactly the error.

Best Regards.

joolfe commented 2 years ago

Hi @alessandro-candon,

The same for you, if you provide the collection that is giving you the error or an example to reproduce the issue I can review and fix it.

Best regards

alexwebgr commented 2 years ago

hey @joolfe thanks for taking some time to look into this!

is there a way i could send you the collection privately?

thanks alex

alessandro-candon commented 2 years ago

@joolfe => sorry It was my mistake... I extract the Postman collection with a JSON body and example and the JSON example was malformed and it cause the SyntaxError. I think it can help others devs. Thank you so much for this incredible work...

joolfe commented 2 years ago

Hi @alessandro-candon, thanks for the advice!

I already checked the error and in the example that @alexwebgr sent to me that was exactly the problem, one of the examples has an empty body for a JSON type what cause the parsing error, I'm working in a new release that will include:

Sorry for the delay guys I have been very busy these weeks and I expect to have time this weekend to release the changes.

Best Regards.

alexwebgr commented 2 years ago

Hey Jorge

That sounds great!

No worries, there's no rush

Thanks Alex

On Tue, Feb 15, 2022, 18:55 Jorge @.***> wrote:

Hi @alessandro-candon https://github.com/alessandro-candon, thanks for the advice!

I already checked the error and in the example that @alexwebgr https://github.com/alexwebgr sent to me that was exactly the problem, one of the examples has an empty body for a JSON type what cause the parsing error, I'm working in a new release that will include:

  • More descriptive errors for these cases, so I will return in which example is failing the parsing.
  • A check to not fail in with empty string so i will just replace with '{}'.

Sorry for the delay guys I have been very busy these weeks and I expect to have time this weekend to release the changes.

Best Regards.

— Reply to this email directly, view it on GitHub https://github.com/joolfe/postman-to-openapi/issues/175#issuecomment-1040522601, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2JR37BGBOUKTSPHRI2HZ3U3KAQPANCNFSM5NJQ34NA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

joolfe commented 2 years ago

New features added into version 2.2.0

Best regards

alexwebgr commented 2 years ago

i have tested the new version and it is working just fine!

thank you for taking the time to look into this :)