OrderedLoadSchemasFromFiles calls LoadSchemaFromFile for each file in right order - first abstract then parent and rest on the end
(filePaths []string)
| 305 | |
| 306 | //OrderedLoadSchemasFromFiles calls LoadSchemaFromFile for each file in right order - first abstract then parent and rest on the end |
| 307 | func (manager *Manager) OrderedLoadSchemasFromFiles(filePaths []string) error { |
| 308 | MaxDepth := 8 // maximum number of nested schemas |
| 309 | for i := MaxDepth; i > 0 && len(filePaths) > 0; i-- { |
| 310 | rest := make([]string, 0) |
| 311 | for _, filePath := range filePaths { |
| 312 | if filePath == "" { |
| 313 | continue |
| 314 | } |
| 315 | err := manager.LoadSchemaFromFile(filePath) |
| 316 | if err != nil && err.Error() != "data isn't map" { |
| 317 | if i == 1 { |
| 318 | return err |
| 319 | } |
| 320 | rest = append(rest, filePath) |
| 321 | } |
| 322 | } |
| 323 | filePaths = rest |
| 324 | } |
| 325 | return nil |
| 326 | } |
| 327 | |
| 328 | //LoadSchemasFromFiles calls LoadSchemaFromFile for each of provided filePaths |
| 329 | func (manager *Manager) LoadSchemasFromFiles(filePaths ...string) error { |
no test coverage detected