A module to use, providing Ecto schemaless types for each JSON file
assert that each object in the file is a valid?: true Ecto changeset.
Some caveats I wanted to note:
casting will not catch a typo like "names" instead of "name". It simply won't include those properties in the changes.
You can perform required validations through the required argument when useing the module. This is the main validation I included and consulted the schemas as to what fields should be required.
If needed, you can override the validate/1 function in a test file. For example, if you needed or wanted to perform additional validations on the changeset for that particular test file.
Why is this change being made?
resolves #78
How is this being accomplished?
use
, providing Ecto schemaless types for each JSON filevalid?: true
Ecto changeset.Some caveats I wanted to note:
cast
ing will not catch a typo like "names" instead of "name". It simply won't include those properties in the changes.required
argument whenuse
ing the module. This is the main validation I included and consulted the schemas as to what fields should be required.validate/1
function in a test file. For example, if you needed or wanted to perform additional validations on the changeset for that particular test file.