Class: GrapeOAS::Exporter::OAS3Schema
- Inherits:
-
Object
- Object
- GrapeOAS::Exporter::OAS3Schema
- Includes:
- Concerns::SchemaIndexer, Concerns::TagBuilder
- Defined in:
- lib/grape_oas/exporter/oas3_schema.rb
Direct Known Subclasses
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(api_model:) ⇒ OAS3Schema
constructor
A new instance of OAS3Schema.
Methods included from Concerns::SchemaIndexer
#build_schema_index, #collect_refs, #collect_schemas_from_operation, #find_schema_by_canonical_name, #index_schema, #schema_index
Methods included from Concerns::TagBuilder
#build_tags, #collect_used_tag_names, #normalize_tag
Constructor Details
#initialize(api_model:) ⇒ OAS3Schema
Returns a new instance of OAS3Schema.
9 10 11 12 13 |
# File 'lib/grape_oas/exporter/oas3_schema.rb', line 9 def initialize(api_model:) @api = api_model @ref_tracker = Set.new @ref_schemas = {} end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/grape_oas/exporter/oas3_schema.rb', line 15 def generate { "openapi" => openapi_version, "info" => build_info, "servers" => build_servers, "tags" => , "paths" => OAS3::Paths.new(@api, @ref_tracker, nullable_strategy: nullable_strategy, suppress_default_error_response: @api.suppress_default_error_response,).build, "components" => build_components, "security" => build_security }.compact end |