-
-
Notifications
You must be signed in to change notification settings - Fork 869
Open
Description
Given a route like this:
<route
id="users.view"
methods="GET"
path="/users/{userId}"
controller="App\Controller\UsersController::view">
<requirement key="userId">[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}</requirement>
</route>
an open API schema gets generated where the path parameter looks like this:
parameters:
-
name: userId
in: path
required: true
schema:
type: string
pattern: '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'
But the pattern docs say that without ^
and $
the pattern is a partial match, not a full string.
For a route, where the generated regex would require the specific, full string it might make sense to change the route describer to surround the requirement with ^...$
.
Here's the regex that symfony generates on that route, for context:
Thoughts?
vodevel
Metadata
Metadata
Assignees
Labels
No labels