The task can be tested in the example app with mix dayron.gen.model User user name age:integer
I still need to update the README with this task usage but you can review the code in the meantime.
About using a json schema to generate the models, I think it can be done relatively easily, this elixir lib does json schema validation, we can use it directly or as inspiration. However I think is better to add support for relationships first because if the user wants to use a schema he probably have a very complex model with relationships.
Coverage decreased (-1.6%) to 98.352% when pulling f8a93db3fc7a27fc01f51410d3b4ec73d7ac7e56 on tiagoengel:generate_model_task into 478d9bdffad4411ca146a8e0e5c2e7402971b55f on inaka:master.
Coverage decreased (-1.6%) to 98.352% when pulling 74a92fcb17fc4734e4a9716b3f09dd792423a887 on tiagoengel:generate_model_task into 478d9bdffad4411ca146a8e0e5c2e7402971b55f on inaka:master.
Coverage remained the same at 100.0% when pulling d3f8a1063f9736265d892aec6b5b6a7a707d76d9 on tiagoengel:generate_model_task into 478d9bdffad4411ca146a8e0e5c2e7402971b55f on inaka:master.
Coverage remained the same at 100.0% when pulling 65d257f1d22c194a2caa03e2a1a4375b4441146b on tiagoengel:generate_model_task into 478d9bdffad4411ca146a8e0e5c2e7402971b55f on inaka:master.
The task can be tested in the example app with
mix dayron.gen.model User user name age:integer
I still need to update the README with this task usage but you can review the code in the meantime.About using a json schema to generate the models, I think it can be done relatively easily, this elixir lib does json schema validation, we can use it directly or as inspiration. However I think is better to add support for relationships first because if the user wants to use a schema he probably have a very complex model with relationships.