Sha256: 9ca6e9ba703d0defce73712daffedf19f57500280042ed2af4516bd6c7281594

Contents?: true

Size: 975 Bytes

Versions: 12

Compression:

Stored size: 975 Bytes

Contents

# frozen_string_literal: true

require_relative 'squeezer/base_squeezer'
require_relative 'squeezer/tag_squeezer'
require_relative 'squeezer/path_squeezer'

module R2OAS
  module Schema
    module V3
      class Squeezer < BaseSqueezer
        def squeeze_docs
          except_paths_schema = @schema_data.except('paths', 'tags', 'components')
          components_schemas = @schema_data.slice('components')

          path_squeezer = PathSqueezer.new(@schema_data, many_paths_file_paths: many_paths_file_paths)
          tag_squeezer = TagSqueezer.new(@schema_data, many_paths_file_paths: many_paths_file_paths)

          # To make components merge after paths
          slice_schemas = [
            tag_squeezer.squeeze_docs,
            path_squeezer.squeeze_docs,
            components_schemas
          ]
          slice_schemas.each_with_object(except_paths_schema) { |slice_schema, result| result.deep_merge!(slice_schema) }
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
r2-oas-0.5.0 lib/r2-oas/schema/v3/squeezer.rb
r2-oas-0.4.1 lib/r2-oas/schema/v3/squeezer.rb
r2-oas-0.4.0 lib/r2-oas/schema/v3/squeezer.rb
r2-oas-0.3.4 lib/r2-oas/schema/v3/squeezer.rb
r2-oas-0.3.3 lib/r2-oas/schema/v3/squeezer.rb
r2-oas-0.3.2 lib/r2-oas/schema/v3/squeezer.rb
r2-oas-0.3.1 lib/r2-oas/schema/v3/squeezer.rb
r2-oas-0.3.0 lib/r2-oas/schema/v3/squeezer.rb
r2-oas-0.2.0 lib/r2-oas/schema/v3/squeezer.rb
r2-oas-0.1.3 lib/r2-oas/schema/v3/squeezer.rb
r2-oas-0.1.2 lib/r2-oas/schema/v3/squeezer.rb
r2-oas-0.1.0 lib/r2-oas/schema/v3/squeezer.rb