# `mix oas.gen.plug`
[🔗](https://github.com/xinz/oasis/blob/main/lib/mix/tasks/oas.gen.plug.ex#L1)

Generates router and plug handlers for a proper OpenAPI Specification in YAML or JSON file.

    mix oas.gen.plug --file path/to/openapi.yaml
    mix oas.gen.plug --file path/to/openapi.yml
    mix oas.gen.plug --file path/to/openapi.json

The arguments of `oas.gen.plug` mix task:

* `--file`, required, the completed path to the specification file in YAML or JSON format.
* `--router`, optional, the generated router's module alias, by default it is `Router` (the full module name is `Oasis.Gen.Router` by default), for example we set `--router Hello.MyRouter` meanwhile there is no other special name space defined, the final router module is `Oasis.Gen.Hello.MyRouter` in `/lib/oasis/gen/hello/my_router.ex` path.
* `--name-space`, optional, the generated all modules' name space, by default it is `Oasis.Gen`, this argument will always override the name space from the input `--file` if any `"x-oasis-name-space"` field(s) defined.
* `--force`, optional, forces creation without a shell prompt.
* `--quiet`, optional, does not log command output.

# `run`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
