Class: Minitest::OpenAPI::Configuration
- Inherits:
-
Object
- Object
- Minitest::OpenAPI::Configuration
- Defined in:
- lib/minitest/openapi/configuration.rb
Overview
Constant Summary collapse
- DEFAULT_BASE =
{ "openapi" => "3.0.3", "info" => {"title" => "API", "version" => "1.0.0"}, "components" => {"schemas" => {}} }.freeze
Instance Attribute Summary collapse
-
#base ⇒ Object
The base document — everything not derived from tests (info, servers, security schemes, reusable component schemas).
-
#output_path ⇒ Object
Where openapi:generate writes the document (relative to Rails.root).
-
#validate_responses ⇒ Object
Validate each response body against its declared schema as tests run.
Instance Method Summary collapse
- #base_document ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
27 28 29 30 31 |
# File 'lib/minitest/openapi/configuration.rb', line 27 def initialize @output_path = "openapi/openapi.json" @validate_responses = true @base = deep_dup(DEFAULT_BASE) end |
Instance Attribute Details
#base ⇒ Object
The base document — everything not derived from tests (info, servers, security schemes, reusable component schemas). A Hash, or a path to a JSON/YAML file. Test-recorded operations are merged into ‘paths`.
36 37 38 |
# File 'lib/minitest/openapi/configuration.rb', line 36 def base @base end |
#output_path ⇒ Object
Where openapi:generate writes the document (relative to Rails.root).
16 17 18 |
# File 'lib/minitest/openapi/configuration.rb', line 16 def output_path @output_path end |
#validate_responses ⇒ Object
Validate each response body against its declared schema as tests run.
19 20 21 |
# File 'lib/minitest/openapi/configuration.rb', line 19 def validate_responses @validate_responses end |
Instance Method Details
#base_document ⇒ Object
47 48 49 |
# File 'lib/minitest/openapi/configuration.rb', line 47 def base_document deep_dup(@base) end |