mix oas.gen.plug (oasis v0.4.0) View Source

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.

Link to this section Summary

Functions

Callback implementation for Mix.Task.run/1.

Link to this section Functions

Callback implementation for Mix.Task.run/1.