inaka / Dayron

A repository `similar` to Ecto.Repo that maps to an underlying http client, sending requests to an external rest api instead of a database
http://inaka.net/blog/2016/05/24/introducing-dayron/
Apache License 2.0
159 stars 20 forks source link

[#49] Mix tasks to generate a Model/Resource #53

Closed tiagoengel closed 8 years ago

tiagoengel commented 8 years ago

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.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.6%) to 98.352% when pulling f8a93db3fc7a27fc01f51410d3b4ec73d7ac7e56 on tiagoengel:generate_model_task into 478d9bdffad4411ca146a8e0e5c2e7402971b55f on inaka:master.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.6%) to 98.352% when pulling 74a92fcb17fc4734e4a9716b3f09dd792423a887 on tiagoengel:generate_model_task into 478d9bdffad4411ca146a8e0e5c2e7402971b55f on inaka:master.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling d3f8a1063f9736265d892aec6b5b6a7a707d76d9 on tiagoengel:generate_model_task into 478d9bdffad4411ca146a8e0e5c2e7402971b55f on inaka:master.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 65d257f1d22c194a2caa03e2a1a4375b4441146b on tiagoengel:generate_model_task into 478d9bdffad4411ca146a8e0e5c2e7402971b55f on inaka:master.