You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am generating swagger docs using rails 5 API, below is my swagger.rb
class Swagger::Docs::Config
def self.base_api_controller
ActionController::API
end
end
Swagger::Docs::Config.register_apis({
"1.0" => {
:controller_base_path => "",
# the extension used for the API
:api_extension_type => :son,
# the output location where your .json files are written to
:api_file_path => "public",
# the URL base path to your API
:base_path => "http://localhost:3000/api",
# if you want to delete all .json files at each generation
:clean_directory => false,
# add custom attributes to api-docs
:attributes => {
:info => {
"title" => "Bookstore App",
"description" => "This is an API for an online bookstore",
"termsOfServiceUrl" => "https://github.com/switzersc/rails-5-api-tutorial",
"contact" => "shelbyswitzer@gmail.com",
"license" => "Apache 2.0",
"licenseUrl" => "http://www.apache.org/licenses/LICENSE-2.0.html"
}
}
}
})
I have able to run rake swagger:docs
successfully and it generated .json file inside public/api folder but I cannot be able to access swagger docs UI through my base path which is http://localhost:3000/api I think I am doing something wrong here
Thanks for reading
The text was updated successfully, but these errors were encountered:
I am generating swagger docs using rails 5 API, below is my swagger.rb
I have able to run
rake swagger:docs
successfully and it generated .json file inside public/api folder but I cannot be able to access swagger docs UI through my base path which is http://localhost:3000/api I think I am doing something wrong here
Thanks for reading
The text was updated successfully, but these errors were encountered: