Skip to content
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

jest-openapi Wrong path with method parsing #301

Open
vitalyiegorov opened this issue Aug 28, 2024 · 0 comments
Open

jest-openapi Wrong path with method parsing #301

vitalyiegorov opened this issue Aug 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@vitalyiegorov
Copy link

Are you using jest or chai?
JEST

Are you using OpenAPI 2, 3.0.X, or 3.1.0?
OpenAPI 3.0.3

Describe the bug clearly
jest-openapi:0.14.2 cannot understand following endpoints configuration:

    /order/{contractId}/{orderId}:
        get:

    /order/{orderId}/{orderItemId}:
        delete:

Steps to reproduce the bug:

  1. Provide following OpenAPI yaml
  2. Run jest test with expect(response).toSatisfyApiSpec();
  3. See error:
expect(received).toSatisfyApiSpec() // Matches 'received' to a response defined in your API spec, then validates 'received' against it

expected received to satisfy a '200' response defined for endpoint 'GET /order/{orderId}/{orderItemId}' in your API spec

received had request method GET, but your API spec has no GET operation defined for path '/order/{orderId}/{orderItemId}'

Request operations found for path '/order/{orderId}/{orderItemId}' in API spec: DELETE

What did you expect to happen instead?
Validator can differentiate paths and pick the right one to validate

Are you going to resolve the issue?
If you guide me where to start, because multiple packages are involved.

@vitalyiegorov vitalyiegorov added the bug Something isn't working label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant