Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work transform_path #149

Open
viveki2it opened this issue Sep 14, 2016 · 1 comment
Open

Does not work transform_path #149

viveki2it opened this issue Sep 14, 2016 · 1 comment

Comments

@viveki2it
Copy link

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 ?

@legendetm
Copy link

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',
   ...
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants