Class: Swaggard::Configuration
- Inherits:
-
Object
- Object
- Swaggard::Configuration
- Defined in:
- lib/swaggard/configuration.rb
Overview
Configuration for Swagger Yard, use like:
Swaggard.configure do |config|
config.api_version = '0.1'
config.api_base_path = '/api'
config.authentication_type = 'header'
config.authentication_key = 'X-AUTHORIZATION'
config.authentication_value = 'you-secret-key'
config.additional_parameters = [{ key: 'STORE-CODE', type: 'header', value: '1' }]
end
Instance Attribute Summary collapse
- #access_password ⇒ Object
- #access_username ⇒ Object
- #additional_parameters ⇒ Object
- #api_base_path ⇒ Object
- #api_formats ⇒ Object
- #api_version ⇒ Object
- #authentication_key ⇒ Object
- #authentication_type ⇒ Object
- #authentication_value ⇒ Object
- #contact_email ⇒ Object
- #contact_name ⇒ Object
- #contact_url ⇒ Object
-
#controllers_path ⇒ Object
Returns the value of attribute controllers_path.
-
#custom_types ⇒ Object
readonly
Returns the value of attribute custom_types.
- #default_content_type ⇒ Object
- #default_response_description ⇒ Object
- #default_response_status_code ⇒ Object
- #description ⇒ Object
- #exclude_base_path_from_paths ⇒ Object
- #excluded_paths ⇒ Object
- #host ⇒ Object
- #ignore_put_if_patch_exists ⇒ Object
- #ignore_undocumented_paths ⇒ Object
- #language ⇒ Object
- #license_name ⇒ Object
-
#models_paths ⇒ Object
Returns the value of attribute models_paths.
- #path_parameter_description ⇒ Object
-
#routes ⇒ Object
Returns the value of attribute routes.
- #schemes ⇒ Object
- #swagger_version ⇒ Object
- #title ⇒ Object
- #tos ⇒ Object
- #use_cache ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#access_password ⇒ Object
100 101 102 |
# File 'lib/swaggard/configuration.rb', line 100 def access_password @access_password ||= '' end |
#access_username ⇒ Object
96 97 98 |
# File 'lib/swaggard/configuration.rb', line 96 def access_username @access_username ||= '' end |
#additional_parameters ⇒ Object
132 133 134 |
# File 'lib/swaggard/configuration.rb', line 132 def additional_parameters @additional_parameters ||= [] end |
#api_base_path ⇒ Object
36 37 38 |
# File 'lib/swaggard/configuration.rb', line 36 def api_base_path @api_base_path ||= '/' end |
#api_formats ⇒ Object
40 41 42 |
# File 'lib/swaggard/configuration.rb', line 40 def api_formats @api_formats ||= [:xml, :json] end |
#api_version ⇒ Object
32 33 34 |
# File 'lib/swaggard/configuration.rb', line 32 def api_version @api_version ||= '0.1' end |
#authentication_key ⇒ Object
88 89 90 |
# File 'lib/swaggard/configuration.rb', line 88 def authentication_key @authentication_key ||= 'api_key' end |
#authentication_type ⇒ Object
84 85 86 |
# File 'lib/swaggard/configuration.rb', line 84 def authentication_type @authentication_type ||= 'query' end |
#authentication_value ⇒ Object
92 93 94 |
# File 'lib/swaggard/configuration.rb', line 92 def authentication_value @authentication_value ||= '' end |
#contact_email ⇒ Object
68 69 70 |
# File 'lib/swaggard/configuration.rb', line 68 def contact_email @contact_email ||= '' end |
#contact_name ⇒ Object
64 65 66 |
# File 'lib/swaggard/configuration.rb', line 64 def contact_name @contact_name ||= '' end |
#contact_url ⇒ Object
72 73 74 |
# File 'lib/swaggard/configuration.rb', line 72 def contact_url @contact_url ||= '' end |
#controllers_path ⇒ Object
Returns the value of attribute controllers_path.
15 16 17 |
# File 'lib/swaggard/configuration.rb', line 15 def controllers_path @controllers_path end |
#custom_types ⇒ Object (readonly)
Returns the value of attribute custom_types.
26 27 28 |
# File 'lib/swaggard/configuration.rb', line 26 def custom_types @custom_types end |
#default_content_type ⇒ Object
104 105 106 |
# File 'lib/swaggard/configuration.rb', line 104 def default_content_type @default_content_type ||= '' end |
#default_response_description ⇒ Object
112 113 114 |
# File 'lib/swaggard/configuration.rb', line 112 def default_response_description @default_response_description ||= 'successful operation' end |
#default_response_status_code ⇒ Object
108 109 110 |
# File 'lib/swaggard/configuration.rb', line 108 def default_response_status_code @default_response_status_code ||= 'default' end |
#description ⇒ Object
56 57 58 |
# File 'lib/swaggard/configuration.rb', line 56 def description @description ||= '' end |
#exclude_base_path_from_paths ⇒ Object
122 123 124 125 126 |
# File 'lib/swaggard/configuration.rb', line 122 def exclude_base_path_from_paths return @exclude_base_path_from_paths unless @exclude_base_path_from_paths.nil? @exclude_base_path_from_paths = false end |
#excluded_paths ⇒ Object
144 145 146 |
# File 'lib/swaggard/configuration.rb', line 144 def excluded_paths @excluded_paths ||= [] end |
#host ⇒ Object
44 45 46 |
# File 'lib/swaggard/configuration.rb', line 44 def host @host ||= '' end |
#ignore_put_if_patch_exists ⇒ Object
156 157 158 159 160 |
# File 'lib/swaggard/configuration.rb', line 156 def ignore_put_if_patch_exists return @ignore_put_if_patch_exists unless @ignore_put_if_patch_exists.nil? @ignore_put_if_patch_exists = false end |
#ignore_undocumented_paths ⇒ Object
116 117 118 119 120 |
# File 'lib/swaggard/configuration.rb', line 116 def ignore_undocumented_paths return @ignore_undocumented_paths unless @ignore_undocumented_paths.nil? @ignore_undocumented_paths = false end |
#language ⇒ Object
128 129 130 |
# File 'lib/swaggard/configuration.rb', line 128 def language @language ||= 'en' end |
#license_name ⇒ Object
76 77 78 |
# File 'lib/swaggard/configuration.rb', line 76 def license_name @license_name ||= '' end |
#models_paths ⇒ Object
Returns the value of attribute models_paths.
15 16 17 |
# File 'lib/swaggard/configuration.rb', line 15 def models_paths @models_paths end |
#path_parameter_description ⇒ Object
152 153 154 |
# File 'lib/swaggard/configuration.rb', line 152 def path_parameter_description @path_parameter_description ||= ->(path_parameter) { "Scope response to #{path_parameter.name}" } end |
#routes ⇒ Object
Returns the value of attribute routes.
15 16 17 |
# File 'lib/swaggard/configuration.rb', line 15 def routes @routes end |
#schemes ⇒ Object
48 49 50 |
# File 'lib/swaggard/configuration.rb', line 48 def schemes @schemes ||= [:https, :http] end |
#swagger_version ⇒ Object
28 29 30 |
# File 'lib/swaggard/configuration.rb', line 28 def swagger_version @swagger_version ||= '2.0' end |
#title ⇒ Object
52 53 54 |
# File 'lib/swaggard/configuration.rb', line 52 def title @title ||= '' end |
#tos ⇒ Object
60 61 62 |
# File 'lib/swaggard/configuration.rb', line 60 def tos @tos ||= '' end |
#use_cache ⇒ Object
136 137 138 |
# File 'lib/swaggard/configuration.rb', line 136 def use_cache @use_cache ||= false end |
Instance Method Details
#add_custom_type(name, definition) ⇒ Object
148 149 150 |
# File 'lib/swaggard/configuration.rb', line 148 def add_custom_type(name, definition) custom_types[name] = definition end |
#license_url ⇒ Object
80 81 82 |
# File 'lib/swaggard/configuration.rb', line 80 def license_url @license_url ||= '' end |