From ac3b9f76d254f84c902bc8c6d19b02e1ead78173 Mon Sep 17 00:00:00 2001 From: asbheelghouri Date: Mon, 1 Jul 2024 17:39:45 +0400 Subject: [PATCH 1/2] load basics --- data/v0/schema.go | 2 +- data/v1/schema.go | 3 +++ data/v2/schema.go | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/data/v0/schema.go b/data/v0/schema.go index edf7499..ae6e85b 100644 --- a/data/v0/schema.go +++ b/data/v0/schema.go @@ -202,7 +202,7 @@ func (s *Schematics) ValidateObject(jsonData *map[string]interface{}, id *string var errorMessages errorHandler.Errors var baseError errorHandler.Error flatData := *s.makeFlat(*jsonData) - Logs.DEBUG("hereher after flat data --> ", flatData) + Logs.DEBUG("here after flat data --> ", flatData) uniqueID := "" if id != nil { diff --git a/data/v1/schema.go b/data/v1/schema.go index 3dd3aeb..d419672 100644 --- a/data/v1/schema.go +++ b/data/v1/schema.go @@ -107,6 +107,8 @@ func transformSchematics(s Schematics) *v0.Schematics { baseSchematics.Validators = s.Validators baseSchematics.Operators = s.Operators baseSchematics.Schema = *transformSchema(s.Schema) + baseSchematics.Validators.BasicValidators() + baseSchematics.Operators.LoadBasicOperations() return &baseSchematics } @@ -127,6 +129,7 @@ func transformSchema(schema Schema) *v0.Schema { AdditionalInformation: field.AdditionalInformation, } } + return &baseSchema } diff --git a/data/v2/schema.go b/data/v2/schema.go index 027718e..67ca1d3 100644 --- a/data/v2/schema.go +++ b/data/v2/schema.go @@ -58,8 +58,6 @@ func (s *Schematics) Configs() { } s.Validators.Logger = Logs s.Operators.Logger = Logs - s.Validators.BasicValidators() - s.Operators.LoadBasicOperations() } func LoadJsonSchemaFile(path string) (*v0.Schematics, error) { @@ -108,6 +106,8 @@ func transformSchematics(s Schematics) *v0.Schematics { baseSchematics.Validators = s.Validators baseSchematics.Operators = s.Operators baseSchematics.Schema = *transformSchema(s.Schema) + baseSchematics.Validators.BasicValidators() + baseSchematics.Operators.LoadBasicOperations() return &baseSchematics } From fc5912d53855b947c05f77176b9e8f00a399943a Mon Sep 17 00:00:00 2001 From: asbheelghouri Date: Mon, 1 Jul 2024 17:41:46 +0400 Subject: [PATCH 2/2] load basics --- data/v1/schema.go | 3 ++- data/v2/schema.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/data/v1/schema.go b/data/v1/schema.go index d419672..e4513ed 100644 --- a/data/v1/schema.go +++ b/data/v1/schema.go @@ -106,9 +106,10 @@ func transformSchematics(s Schematics) *v0.Schematics { baseSchematics.Separator = s.Separator baseSchematics.Validators = s.Validators baseSchematics.Operators = s.Operators - baseSchematics.Schema = *transformSchema(s.Schema) baseSchematics.Validators.BasicValidators() baseSchematics.Operators.LoadBasicOperations() + baseSchematics.Schema = *transformSchema(s.Schema) + return &baseSchematics } diff --git a/data/v2/schema.go b/data/v2/schema.go index 67ca1d3..e77e9ff 100644 --- a/data/v2/schema.go +++ b/data/v2/schema.go @@ -105,9 +105,9 @@ func transformSchematics(s Schematics) *v0.Schematics { baseSchematics.Separator = s.Separator baseSchematics.Validators = s.Validators baseSchematics.Operators = s.Operators - baseSchematics.Schema = *transformSchema(s.Schema) baseSchematics.Validators.BasicValidators() baseSchematics.Operators.LoadBasicOperations() + baseSchematics.Schema = *transformSchema(s.Schema) return &baseSchematics }