Skip to content

router param for a part of all my routes #288

@GildedHonour

Description

@GildedHonour

There's the "router" argument

 swagger_files: %{
    "priv/static/swagger.json" => [
      router: MyAppWeb.Router,     # phoenix routes will be converted to swagger paths
      endpoint: MyAppWeb.Endpoint  # (optional) endpoint config used to set host, port and https schemes.
    ]
  }

What if I needed to create Swagger docs for only a part of all the routes in my router.ex?

Or if I had multiple APIs in it? private one, public one, something else

In other words, how will phoenix_swagger know which scope it must generate API docs for? I might name my api route-scope /my_super_route rather than /api.

Or does it use priv/static/swagger.json only and doesn't care what's in router.ex?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions