Class: AnotherApi::OpenAPI::Configuration
- Inherits:
-
Object
- Object
- AnotherApi::OpenAPI::Configuration
- Defined in:
- lib/another_api/openapi/configuration.rb
Instance Attribute Summary collapse
-
#additional_discovery_variants ⇒ Object
Returns the value of attribute additional_discovery_variants.
-
#common_parameters ⇒ Object
Returns the value of attribute common_parameters.
-
#concern_map ⇒ Object
readonly
Returns the value of attribute concern_map.
-
#controllers_glob ⇒ Object
Returns the value of attribute controllers_glob.
-
#default_variant_name ⇒ Object
Returns the value of attribute default_variant_name.
-
#description ⇒ Object
Returns the value of attribute description.
-
#eager_load_controllers ⇒ Object
Returns the value of attribute eager_load_controllers.
-
#error_response_content ⇒ Object
Returns the value of attribute error_response_content.
-
#filter_expression_schema ⇒ Object
Returns the value of attribute filter_expression_schema.
-
#info_extra ⇒ Object
Returns the value of attribute info_extra.
-
#pagination_metadata_schema ⇒ Object
Returns the value of attribute pagination_metadata_schema.
-
#path_prefix ⇒ Object
Returns the value of attribute path_prefix.
-
#schema_namespace_prefix ⇒ Object
Returns the value of attribute schema_namespace_prefix.
-
#security ⇒ Object
Returns the value of attribute security.
-
#security_schemes ⇒ Object
Returns the value of attribute security_schemes.
-
#servers ⇒ Object
Returns the value of attribute servers.
-
#title ⇒ Object
Returns the value of attribute title.
-
#version ⇒ Object
Returns the value of attribute version.
-
#watched_dirs ⇒ Object
Returns the value of attribute watched_dirs.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #register_concern(module_name, key) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/another_api/openapi/configuration.rb', line 18 def initialize @title = "API" @description = nil @version = "1.0.0" @path_prefix = "" # Empty string means "no namespace stripping": every ApiSerializer::Schema # subclass referenced via api_action(schema:) is included, but no # ObjectSpace auto-discovery happens. Set to a string like # "MyApp::Schemas::V1::" to opt into auto-discovery of nested schemas. @schema_namespace_prefix = "" @default_variant_name = :full @additional_discovery_variants = [:minimal] @controllers_glob = "app/controllers/**/*_controller.rb" @eager_load_controllers = true # Paths under Rails.root that SpecRenderer watches for mtime changes # to invalidate its dev-mode cache. @watched_dirs = ["app/controllers"] @info_extra = {} @servers = nil @security_schemes = AnotherApi::OpenAPI::CommonSchemas.default_security_schemes @security = [{bearerAuth: []}] @common_parameters = AnotherApi::OpenAPI::CommonSchemas.default_parameters @pagination_metadata_schema = AnotherApi::OpenAPI::CommonSchemas. @filter_expression_schema = {type: "string", description: "Filter expression. See API documentation for syntax."} @error_response_content = AnotherApi::OpenAPI::CommonSchemas.default_error_response # Default concerns shipped with another_api. Users can register their # own app-level concern modules with #register_concern. @concern_map = { "AnotherApi::Paginated" => :paginated, "AnotherApi::FilteredAndSorted" => :filtered_and_sorted, "AnotherApi::SchemaConfigurable" => :schema_configurable } end |
Instance Attribute Details
#additional_discovery_variants ⇒ Object
Returns the value of attribute additional_discovery_variants.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def additional_discovery_variants @additional_discovery_variants end |
#common_parameters ⇒ Object
Returns the value of attribute common_parameters.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def common_parameters @common_parameters end |
#concern_map ⇒ Object (readonly)
Returns the value of attribute concern_map.
16 17 18 |
# File 'lib/another_api/openapi/configuration.rb', line 16 def concern_map @concern_map end |
#controllers_glob ⇒ Object
Returns the value of attribute controllers_glob.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def controllers_glob @controllers_glob end |
#default_variant_name ⇒ Object
Returns the value of attribute default_variant_name.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def default_variant_name @default_variant_name end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def description @description end |
#eager_load_controllers ⇒ Object
Returns the value of attribute eager_load_controllers.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def eager_load_controllers @eager_load_controllers end |
#error_response_content ⇒ Object
Returns the value of attribute error_response_content.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def error_response_content @error_response_content end |
#filter_expression_schema ⇒ Object
Returns the value of attribute filter_expression_schema.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def filter_expression_schema @filter_expression_schema end |
#info_extra ⇒ Object
Returns the value of attribute info_extra.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def info_extra @info_extra end |
#pagination_metadata_schema ⇒ Object
Returns the value of attribute pagination_metadata_schema.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def @pagination_metadata_schema end |
#path_prefix ⇒ Object
Returns the value of attribute path_prefix.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def path_prefix @path_prefix end |
#schema_namespace_prefix ⇒ Object
Returns the value of attribute schema_namespace_prefix.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def schema_namespace_prefix @schema_namespace_prefix end |
#security ⇒ Object
Returns the value of attribute security.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def security @security end |
#security_schemes ⇒ Object
Returns the value of attribute security_schemes.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def security_schemes @security_schemes end |
#servers ⇒ Object
Returns the value of attribute servers.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def servers @servers end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def title @title end |
#version ⇒ Object
Returns the value of attribute version.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def version @version end |
#watched_dirs ⇒ Object
Returns the value of attribute watched_dirs.
6 7 8 |
# File 'lib/another_api/openapi/configuration.rb', line 6 def watched_dirs @watched_dirs end |
Instance Method Details
#register_concern(module_name, key) ⇒ Object
60 61 62 |
# File 'lib/another_api/openapi/configuration.rb', line 60 def register_concern(module_name, key) @concern_map = @concern_map.merge(module_name.to_s => key.to_sym) end |