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

Add regex pattern match against the requested url path (#1) #197

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paulund
Copy link

@paulund paulund commented Aug 5, 2024

  • Add regex pattern match against the requested url path

This issue came from having static URLs in the API documentation pointing to dynamic URL in my project.

/cars/electric
/cars/ice
Route::patch('/cars/{name}', function ($name) {
    return [
        'name' => $name,
    ];
});

Before this change it will also match with the last defined route in the API documentation, which meant that if the request data was different then the request openAPI validation will fail.

This change will use the route binding regex and the actual request path to find the correct path. Now it will only match the exact match routes if found.

* Add regex pattern match against the requested url path

* Update title of yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant