Sha256: a4e2ea46bafa9285e882f16dcacc454df9e31f0520b42e2905a77c70776a3348

Contents?: true

Size: 649 Bytes

Versions: 8

Compression:

Stored size: 649 Bytes

Contents

# frozen_string_literal: true

module SwaggerDocsGenerator
  # # Metadata generated
  #
  # Generate metadata for block paths in swagger specification
  #
  # @see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#pathsObject
  class MetadataPath < MetadataController
    def initialize
      super
    end

    # Each controller parsed
    def construct_swagger_file
      hash = {}
      controllers.each do |controller|
        file = File.join(file_path, "#{controller.controller_name}.json")
        hash.merge!(JSON.parse(File.read(file))['paths']) if File.exist?(file)
      end
      { paths: hash }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
swagger_docs_generator-0.2.0 lib/swagger_docs_generator/metadata/path.rb
swagger_docs_generator-0.2.0.pre.14 lib/swagger_docs_generator/metadata/path.rb
swagger_docs_generator-0.2.0.pre.13 lib/swagger_docs_generator/metadata/path.rb
swagger_docs_generator-0.2.0.pre.12 lib/swagger_docs_generator/metadata/path.rb
swagger_docs_generator-0.2.0.pre.11 lib/swagger_docs_generator/metadata/path.rb
swagger_docs_generator-0.2.0.pre.10 lib/swagger_docs_generator/metadata/path.rb
swagger_docs_generator-0.2.0.pre.9 lib/swagger_docs_generator/metadata/path.rb
swagger_docs_generator-0.1.2 lib/swagger_docs_generator/metadata/path.rb