-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add methods for documenting authorization.
- Loading branch information
Showing
20 changed files
with
253 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# config/initializers/oas_rails.rb | ||
OasRails.configure do |config| | ||
# Basic Information about the API | ||
config.info.title = 'OasRails' | ||
config.info.summary = 'OasRails: Automatic Interactive API Documentation for Rails' | ||
config.info.description = <<~HEREDOC | ||
|
@@ -34,17 +35,55 @@ | |
Explore your API documentation and enjoy the power of OasRails! | ||
For more information and advanced usage, visit the [OasRails GitHub repository](https://github.com/a-chacon/oas_rails). | ||
HEREDOC | ||
config.info.contact.name = 'a-chacon' | ||
config.info.contact.email = '[email protected]' | ||
config.info.contact.url = 'https://a-chacon.com' | ||
|
||
# Servers Information. For more details follow: https://spec.openapis.org/oas/latest.html#server-object | ||
config.servers = [{ url: 'http://localhost:3000', description: 'Local' }] | ||
|
||
# Tag Information. For more details follow: https://spec.openapis.org/oas/latest.html#tag-object | ||
config.tags = [{ name: "Users", description: "Manage the `amazing` Users table." }] | ||
|
||
# config.default_tags_from = :namespace # Could be: :namespace or :controller | ||
# config.autodiscover_request_body = true # Try to get request body for create and update methods based on the controller name. | ||
# config.autodiscover_responses = true # Looks for renders in your source code and try to generate the responses. | ||
# config.api_path = "/" # set this config if your api is in a different namespace other than / | ||
# Optional Settings (Uncomment to use) | ||
|
||
# Extract default tags of operations from namespace or controller. Can be set to :namespace or :controller | ||
# config.default_tags_from = :namespace | ||
|
||
# Automatically detect request bodies for create/update methods | ||
# Default: true | ||
# config.autodiscover_request_body = false | ||
|
||
# Automatically detect responses from controller renders | ||
# Default: true | ||
# config.autodiscover_responses = false | ||
|
||
# API path configuration if your API is under a different namespace | ||
# config.api_path = "/" | ||
|
||
# ####################### | ||
# Authentication Settings | ||
# ####################### | ||
|
||
# Whether to authenticate all routes by default | ||
# Default is true; set to false if you don't want all routes to include secutrity schemas by default | ||
# config.authenticate_all_routes_by_default = true | ||
|
||
# Default security schema used for authentication | ||
# Choose a predefined security schema | ||
# [:api_key_cookie, :api_key_header, :api_key_query, :basic, :bearer, :bearer_jwt, :mutual_tls] | ||
# config.security_schema = :bearer | ||
|
||
# Custom security schemas | ||
# You can uncomment and modify to use custom security schemas | ||
# Please follow the documentation: https://spec.openapis.org/oas/latest.html#security-scheme-object | ||
# | ||
# config.security_schemas = { | ||
# bearer:{ | ||
# "type": "apiKey", | ||
# "name": "api_key", | ||
# "in": "header" | ||
# } | ||
# } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.