Rolodex v0.4.0 Rolodex.Config

Configuration for Rolodex.

You can define this config in your config/<env>.exs files, keyed by :rolodex, and it will be passed into new/1 in Mix.Tasks.GenDocs.run/1.

Options

  • description (required) - Description for your documentation output
  • router (required) - Phoenix.Router module to inspect
  • title (required) - Title for your documentation output
  • version (required) - Your documentation's version
  • filters (default: :none) - A list of maps or functions used to filter out routes from your documentation. Filters are matched against Rolodex.Route structs in Rolodex.Route.matches_filter?/2.
  • locale (default: "en") - Locale key to use when processing descriptions
  • pipelines (default: %{}) - Map of pipeline configs. Used to set default parameter values for all routes in a pipeline. See Rolodex.PipelineConfig.
  • processor (default: Rolodex.Processors.Swagger) - Module implementing the Rolodex.Processor behaviour
  • server_urls (default: []) - List of base url(s) for your API paths
  • writer (default: Rolodex.WriterConfig.t()) - Destination for writing and a module implementing the Rolodex.Writer behaviour

Example

config :rolodex,

title: "MyApp",
description: "An example",
version: "1.0.0",
router: MyRouter,
processor: Rolodex.Processors.Swagger,
writer: [
  file_name: "my_docs.json",
  module: Rolodex.Writers.FileWriter
],
pipelines: [
  api: [
    headers: %{"X-Request-Id" => :uuid}
  ]
]

Link to this section Summary

Link to this section Types

Link to this type

pipeline_configs()
pipeline_configs() :: %{optional(:atom) => Rolodex.PipelineConfig.t()}

Link to this type

t()
t() :: %Rolodex.Config{
  description: binary(),
  filters: [map() | (Rolodex.Route.t() -> boolean())] | :none,
  locale: binary(),
  pipelines: pipeline_configs() | nil,
  processor: module(),
  router: module(),
  server_urls: [binary()],
  title: binary(),
  version: binary(),
  writer: Rolodex.WriterConfig.t()
}

Link to this section Functions

Link to this function

new(kwl \\ [])
new(list()) :: Rolodex.Config.t()