-
Notifications
You must be signed in to change notification settings - Fork 48
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
add schema validator interface and implementation #44
add schema validator interface and implementation #44
Conversation
Forge.TreeWalker.UnitTests/test/ActionsCallbacksAndValidator/TreeSchemaValidator.cs
Outdated
Show resolved
Hide resolved
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.
🕐
… method, remove all apis that don't take rules input and fix tests
treeSchemas = new Dictionary<string, ForgeTree>(); | ||
treeSchemas.Add("tree1", treeSchema); | ||
treeSchemas.Add("tree2", treeSchema); | ||
treeSchemas.Add("tree3", treeSchema); |
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.
Let's rename these:
treeSchema -> forgeTree
treeSchemas -> forgeTreeDictionary #Closed
public void TestInitialize() | ||
{ | ||
forgeTreeFromPath = Path.Combine(Environment.CurrentDirectory, "test\\ExampleSchemas\\TardigradeSchema.json"); | ||
schemaDirectoryPath = Path.Combine(Environment.CurrentDirectory, "test\\ExampleSchemas"); |
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.
forgeTreeFromPath = Path.Combine(Environment.CurrentDirectory, "test\\ExampleSchemas\\TardigradeSchema.json"); | ||
schemaDirectoryPath = Path.Combine(Environment.CurrentDirectory, "test\\ExampleSchemas"); | ||
stringRules = File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "contracts\\ForgeSchemaValidationRules.json")); | ||
rulesForDictionary = File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "contracts\\ForgeSchemaDictionaryValidationRules.json")); |
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.
schemaDirectoryPath = Path.Combine(Environment.CurrentDirectory, "test\\ExampleSchemas"); | ||
stringRules = File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "contracts\\ForgeSchemaValidationRules.json")); | ||
rulesForDictionary = File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "contracts\\ForgeSchemaDictionaryValidationRules.json")); | ||
linkedRulesForDictionary = ForgeSchemaValidator.GetLinkedJSchemaRules(rulesForDictionary, stringRules, "//ForgeSchemaValidationRules.json"); |
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.
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.
expose api for schema validation use