You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To improve the flexibility of parameterized path, it would be very useful to support detailed parameter options for validation.
This feature would allow specifying additional constraints directly in the path, such as type, length, range, and custom patterns.
Example
Examples of the proposed syntax include:
/foo/{bar:type=int,range=[0,10]}/ - Validates that bar is an integer within the range of 0 to 10.
/foo/{bar:type=string,max_len=10}/ - Validates that bar is a string with a maximum length of 10 characters.
/foo/{bar:type=string,pattern=^[0-9-]+$}/ - validates that bar matches the specified regex pattern.
implementation
To implement this feature, we might consider adding a new parsing method in the ParameterizedPathMapping class.
Also, we might need a new class that is responsible for applying the specified validations on the input values.
The text was updated successfully, but these errors were encountered:
Recommended by @trustin.
Background
To improve the flexibility of parameterized path, it would be very useful to support detailed parameter options for validation.
This feature would allow specifying additional constraints directly in the path, such as type, length, range, and custom patterns.
Example
Examples of the proposed syntax include:
/foo/{bar:type=int,range=[0,10]}/
- Validates that bar is an integer within the range of 0 to 10./foo/{bar:type=string,max_len=10}/
- Validates that bar is a string with a maximum length of 10 characters./foo/{bar:type=string,pattern=^[0-9-]+$}/
- validates that bar matches the specified regex pattern.implementation
To implement this feature, we might consider adding a new parsing method in the
ParameterizedPathMapping
class.Also, we might need a new class that is responsible for applying the specified validations on the input values.
The text was updated successfully, but these errors were encountered: