apideck-libraries / portman

Port OpenAPI Specs to Postman Collections, inject test suite and run via Newman 👨🏽‍🚀
http://getportman.com/
Apache License 2.0
638 stars 59 forks source link

Feature Request - warn when an invalid openApiOperationId is specified #632

Closed jpjpjp closed 2 weeks ago

jpjpjp commented 3 months ago

I recently discovered that some of the tests I thought I had written weren't being created. After some investigation, I realized that the OperationId I specified didn't match what was in my spec.

In my case I had a variation test that looked something like this:

version: 1.0
tests:
  integrationTests:
    - name: /categories tests
       operations:
         - openApiOperationId: updateCategoryById
            openApiResponse: '200'
            variations:

Since my spec file didn't have an updateCategoryById none of the tests specified in this section got generated.

It would be nice if Portman would generate a warning, or even outright fail when it can't find a specified OpenAPIOperationId

Thanks for your consideration!

thim81 commented 1 month ago

hi @jpjpjp

Would this be something you had in mind for the warning? image

Question: what would be the default? That this warning is displayed or only when the --warn parameter is included?

jpjpjp commented 1 month ago

Yes. This would be really helpful to catch mistakes!

thim81 commented 2 weeks ago

hi @jpjpjp

We just released version 1.30.5 of Portman, which includes the warning when a target does not exist in the OpenAPI spec. Let us know if you have improvements or ideas.

Closing this feature request as completed.