fix: is the root folder required (close #1633)
This commit is contained in:
@ -28,11 +28,11 @@ type IRootId interface {
|
||||
}
|
||||
|
||||
type RootPath struct {
|
||||
RootFolderPath string `json:"root_folder_path" required:"true"`
|
||||
RootFolderPath string `json:"root_folder_path"`
|
||||
}
|
||||
|
||||
type RootID struct {
|
||||
RootFolderID string `json:"root_folder_id" required:"true"`
|
||||
RootFolderID string `json:"root_folder_id"`
|
||||
}
|
||||
|
||||
func (r RootPath) GetRootPath() string {
|
||||
|
@ -145,8 +145,11 @@ func getAdditionalItems(t reflect.Type, defaultRoot string) []driver.Item {
|
||||
if tag.Get("type") != "" {
|
||||
item.Type = tag.Get("type")
|
||||
}
|
||||
if (item.Name == "root_folder_id" || item.Name == "root_folder_path") && item.Default == "" {
|
||||
item.Default = defaultRoot
|
||||
if item.Name == "root_folder_id" || item.Name == "root_folder_path" {
|
||||
if item.Default == "" {
|
||||
item.Default = defaultRoot
|
||||
}
|
||||
item.Required = item.Default != ""
|
||||
}
|
||||
// set default type to string
|
||||
if item.Type == "" {
|
||||
|
Reference in New Issue
Block a user