-
Notifications
You must be signed in to change notification settings - Fork 299
add param type date and date-picker #733
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,8 @@ const ( | |
| TOOL_PARAMETER_ARRAY ToolParameterType = ARRAY | ||
| TOOL_PARAMETER_OBJECT ToolParameterType = OBJECT | ||
| TOOL_PARAMETER_TYPE_CHECKBOX ToolParameterType = CHECKBOX | ||
| TOOL_PARAMETER_TYPE_DATE ToolParameterType = DATE | ||
| TOOL_PARAMETER_TYPE_DATE_PICKER ToolParameterType = DATE_PICKER | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider whether both |
||
| ) | ||
|
|
||
| func isToolParameterType(fl validator.FieldLevel) bool { | ||
|
|
@@ -69,7 +71,9 @@ func isToolParameterType(fl validator.FieldLevel) bool { | |
| string(TOOL_PARAMETER_TYPE_DYNAMIC_SELECT), | ||
| string(TOOL_PARAMETER_ARRAY), | ||
| string(TOOL_PARAMETER_OBJECT), | ||
| string(TOOL_PARAMETER_TYPE_CHECKBOX): | ||
| string(TOOL_PARAMETER_TYPE_CHECKBOX), | ||
| string(TOOL_PARAMETER_TYPE_DATE), | ||
| string(TOOL_PARAMETER_TYPE_DATE_PICKER): | ||
| return true | ||
| } | ||
| return false | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The addition of the
DATEtype highlights a limitation in theToolParameterstruct (line 128), whereMinandMaxare defined as*float64. These fields cannot be used to enforce date range constraints. Additionally, there is currently no validation for theDefaultvalue to ensure it follows a specific format (e.g., ISO 8601). Consider updating the validation logic to support these requirements for date-related types.