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

Does not work transform_path

Open viveki2it opened this issue 9 years ago • 1 comments

I have added to below code to the my initializers config file.

class Swagger::Docs::Config def self.transform_path(path, api_version) # Make a distinction between the APIs and API documentation paths.
"apidocs/#{path}" end

end

But it is not creating the current paths ...

Please let me know what i have to do ?

viveki2it avatar Sep 14 '16 11:09 viveki2it

The documentation says that the transform_path transformation will be applied to all API path values in the generated api-docs.json file, so this does NOT change the location of generated docs.

You need to use :api_file_path option in conjunction with the transform_path to change the location.

class Swagger::Docs::Config
  def self.transform_path(path, api_version)
    "api-docs/#{path}"
  end
end

Swagger::Docs::Config.register_apis(
  'v1': {
    api_file_path: 'public/api-docs',
   ...
)

legendetm avatar Feb 14 '17 08:02 legendetm