microsoft / dev-proxy

Dev Proxy is an API simulator that helps you effortlessly test your app beyond the happy path.
https://aka.ms/devproxy
MIT License
481 stars 56 forks source link

Bug: Path with parameter incorrectly translated to an OpenAPI spec path #787

Closed waldekmastykarz closed 3 months ago

waldekmastykarz commented 3 months ago

If you generate an OpenAPI spec for a request that ends with a parameter, the OpenApiSpecGeneratorPlugin incorrectly adds a trailing slash to the generated path. This leads to a mismatch for subsequent requests and issues in API onboarding scenarios with API Center where the request can't be matched to a previously onboarded request.

Repro

Generate API spec for curl -ix http://127.0.0.1:8000 -X DELETE https://jsonplaceholder.typicode.com/posts/1

Expected

API spec with path /posts/{posts-id}

Actual

API spec with path /posts/{posts-id}/