Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Required Fields V2 - Conditionally Required Fields (#2099)
* PoC for direct builder defined JSON Schema with working unit test * Adds more unit tests * Renames definition.validSchema to definition.groupConditions and restricts them to anyOf, allOf, oneOf which are all a list of fieldKeys * WIP - implementation of DependsOnConditions conversion to JsonSchema * Generates a basic schema. Passes basic test case * More unit tests, non-passing * Able to generate schema when there are multiple conditions on one field defined for one field. * WIP - unit tests * WIP - two cases failing, not from an incorrectly created schema * All test cases for multiple conditions on same field passing * Can validate a basic object dependency * Can validate a basic object dependency with an is_not operator * Adds more object test cases * Adds unit tests for different value data types * Can validate simple conditions with undefined values * Adds new unit tests for multiple conditions with an undefined value. Adds a new unit test for multiple object dependant conditions * Some helper methods and DRYing * WIP - only test object case * WIP - renames helper method to be more descriptive * WIP - enable all unit tests * WIP - factors out singleConditionSingleDependency case * WIP - factors out singleConditionSingleDependency case * WIP - simplifies multiple non-object case * WIP - simplifies multiple object case. actually passes multiple: true parameter which fixes 3 unit tests * Removes commented out code * Fixed incorrect test case, all test cases passing * Removes 3 year old todo unit test * Removes groupConditions as they'll be implemented in a separate PR * Renames fields-to-jsonschema file to indicate it only contains snapshot tests. generates snapshots * Removes dedicated snapshot tests and just makes all existing tests also a snapshot test * Skips conditions when generating types for the stored file * WIP - unit test for null values * Adds conditional requirement to Lead V2 action as well * Handles explicitly null values as if they were undefined fields * Removes conditionally required from Lead V2 since that action relies on syncMode * Consolidates two test cases into one since they share a schema. Removes a console log * WIP - conditionally required object sub-property unit test * WIP - working on conditionally required object properties * Can validate conditionally required object properties * Unit test for when two fields depend on each other * Updates readme and the description for the required property with info on how conditional fields work * Adds dot notation example in readme
- Loading branch information