Class: RailsAutodoc::OpenapiSpecBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_autodoc/openapi_spec_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(operations:, config: RailsAutodoc.config, registry: RailsAutodoc.registry, schema_mapper: SchemaMapper.new) ⇒ OpenapiSpecBuilder

Returns a new instance of OpenapiSpecBuilder.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/rails_autodoc/openapi_spec_builder.rb', line 5

def initialize(
  operations:,
  config: RailsAutodoc.config,
  registry: RailsAutodoc.registry,
  schema_mapper: SchemaMapper.new
)
  @operations = operations
  @config = config
  @registry = registry
  @schema_mapper = schema_mapper
end

Instance Method Details

#buildObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/rails_autodoc/openapi_spec_builder.rb', line 17

def build
  {
    "openapi" => "3.0.3",
    "info" => info_block,
    "servers" => servers_block,
    "tags" => tags_block,
    "paths" => paths_block,
    "components" => components_block
  }.compact
end