Mix tasks reading args from a file?

Is it possible to create custom Mix Tasks that get args from a JSON or YAML file?

I am looking into the possibility of running the existing Phoenix generators using Swagger/OpenAPI 3 as the source of the args.

I know I am supposed to create Phoenix mustache templates in Swagger-gen/OpenAPI3 generator but I would prefer to read the Swagger/OpenAPI3 files and pass them to mix Phoenix generators

cheat

$ mix foo --template "$(cat ./my-file.json)"
1 Like