Does not work transform_path
viveki2it opened this issue · comments
Vivek Reddy commented
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 ?
Raido commented
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',
...
)