Skip to content

Commit f90bc11

Browse files
committed
Document the spec export task --filename option
1 parent c1dbca1 commit f90bc11

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/mix/tasks/openapi.spec.json.ex

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
defmodule Mix.Tasks.Openapi.Spec.Json do
2+
@default_filename "openapi.json"
23
@moduledoc """
34
Serialize the given OpenApi spec module to a JSON file.
45
@@ -21,12 +22,12 @@ defmodule Mix.Tasks.Openapi.Spec.Json do
2122
(defaults to true)
2223
2324
* `--quiet` - Whether to disable output printing (defaults to false)
25+
26+
* `--filename` - The output filename (defaults to "#{@default_filename}")
2427
"""
2528
use Mix.Task
2629
require Mix.Generator
2730

28-
@default_filename "openapi.json"
29-
3031
@impl true
3132
def run(argv) do
3233
{opts, _, _} = OptionParser.parse(argv, strict: [start_app: :boolean])

lib/mix/tasks/openapi.spec.yaml.ex

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
defmodule Mix.Tasks.Openapi.Spec.Yaml do
2+
@default_filename "openapi.yaml"
23
@moduledoc """
34
Serialize the given OpenApi spec module to a YAML file.
45
@@ -18,11 +19,12 @@ defmodule Mix.Tasks.Openapi.Spec.Yaml do
1819
(defaults to true)
1920
2021
* `--quiet` - Whether to disable output printing (defaults to false)
22+
23+
* `--filename` - The output filename (defaults to "#{@default_filename}")
2124
"""
2225
use Mix.Task
2326
require Mix.Generator
2427

25-
@default_filename "openapi.yaml"
2628
@dialyzer {:nowarn_function, encoder: 0}
2729

2830
@impl Mix.Task

0 commit comments

Comments
 (0)