swagger-docs icon indicating copy to clipboard operation
swagger-docs copied to clipboard

How to configure `path` in `api-docs.json`

Open skatenerd opened this issue 7 years ago • 0 comments

When I generate documentation, this line comes out as "path": "/foo.{format}". foo is presumably derived from the name of the controller that serves this route.

Is there any way to change foo to a value that I control?

In particular, foo is inconsistent with the paths contained in the resource-specific documentation. So, in other words, I have:

# api_documentation/foo.json
{
  "apiVersion": "1.0",
  "swaggerVersion": "1.2",
  "basePath": "http://mysite.com",
  "resourcePath": "/bar",
  "apis": [
    {
      "path": "/bar/{param}.json",
      "operations": [
        {
          "summary": "Get a thing",
          "parameters": [{...}],
          "nickname": "FooController#method",
          "method": "get"
        }
      ]
    },
  ]
}
# api_documentation/api-docs.json
{
  "apiVersion": "1.0",
  "swaggerVersion": "1.2",
  "basePath": "http://mysite.com",
  "apis": [
    {
      "path": "/foo.{format}",
      "description": "Get Info On Things"
    }
  ]
}

And I would like to be consistently showing bar instead of foo.

Is there a way to do this without renaming my controller?

skatenerd avatar Apr 04 '17 15:04 skatenerd