-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postman CollectionTypeError on empty examples object #652
Comments
hi @miriamgreis Looking into the matter. |
No, just running Portman with the local OpenAPI file. Nothing special. |
Openapi-format is only triggered when there is a filterFile passed along, so I'll look further in the matter. Do you happen to know, in which version it still worked? |
I just tried to figure it out as I had a very old version installed locally. The first version that I see the error message with is v1.29.0, but you might want to doublecheck. Could be a problem with convertV2? |
@miriamgreis Found the issue: the openapi-to-postman "convertV2" fails. We introduced the V2 method, which has become the default by Postman, in v1.29. I'm created an the issue in the openapi-to-postman github. |
Great, thanks for creating the issue. How is Portman supposed to behave if convertV2 fails? Because right now it doesn't fail on these errors. |
It should fail:
Let me double check if the error trigger is not properly catched in the nesting. |
hi @miriamgreis, an update: We just submitted a PR that should overcome the error in the openapi-to-postman library. |
as possible work-arounds for now:
Since openapi-to-postman does not throw an error and returns a postman obj, we cannot catch the error with proper exit 1 code. In the PR on openapi-to-postman, we added the throwing of an error. |
Perfect, thanks. For now I anyway manually removed the empty example anyway. I saw your PR for openapi-to-postman, so seems that everything needs to be resolved on their side. |
update: The PR for openapi-to-postman is merged in. |
If I use the following stripped-down OpenAPI file, I get an error during the conversion saying:
Converting OpenAPI to Postman Collection Type Error: Cannot read properties of undefined (reading '$ref')
.The problem is the empty
examples: {}
which is sometimes autogenerated by Stoplight Studio. This wasn't a problem with earlier versions of Portman, so I assume that it is related to some recent openapi-format updates. I'm not sure whether this can be fixed here, but for me it's most important that Portman fails on such errors when I use it in the CI. Otherwise, nobody will realise that the tests are not generated at all.The text was updated successfully, but these errors were encountered: