hotmeteor / spectator

OpenAPI testing for PHP
MIT License
285 stars 53 forks source link

Add assertPathExists assertion #146

Closed lentex closed 1 year ago

lentex commented 1 year ago

This assertion is a convenient way to only check whether an endpoint is in the spec or not.

Concrete use case in one of my projects: Iteration over all endpoints in API and check for every one of them whether they are present in the specification. When adding these tests in the CI pipeline I can make sure that new endpoints also find their way into the specification.

Why can't I just use assertInvalidRequest? Because when automatically iterating over endpoints I don't have request bodies to append and so the assertion complains about this first. I just want to know about the InvalidPathException.

Hope this finds the way into the codebase, otherwise I would have to find a way to extend the package.