End LoadSchema determineSchemaType determines the type of schema based on the input string
(input string)
| 48 | } // End LoadSchema |
| 49 | // determineSchemaType determines the type of schema based on the input string |
| 50 | func determineSchemaType(input string) (Type, error) { |
| 51 | if isURL(input) { // Check URL first |
| 52 | return URL, nil // Return URL type |
| 53 | } // Not URL |
| 54 | valid, err := isFilePath(input) // Check if file path |
| 55 | if err != nil { |
| 56 | return Inline, nil |
| 57 | } |
| 58 | if valid { |
| 59 | return File, nil |
| 60 | } |
| 61 | return Inline, nil // Default to inline |
| 62 | } // End determineSchemaType |
| 63 | func isURL(input string) bool { // Check if input is URL |
| 64 | parsedURL, err := url.Parse(input) |
| 65 | if err != nil { |
no test coverage detected