Sha256: 221cdf817c9ffd288ae88f328060822abd988e8508c641427dd10ae8475ec91d

Contents?: true

Size: 631 Bytes

Versions: 8

Compression:

Stored size: 631 Bytes

Contents

# frozen_string_literal: true

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

    # Create tag
    def construct_swagger_file
      array = []
      controllers.each do |controller|
        file = File.join(file_path, "#{controller.controller_name}.json")
        array.push(JSON.parse(File.read(file))['tags']) if File.exist?(file)
      end
      { tags: array }
    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/tag.rb
swagger_docs_generator-0.2.0.pre.14 lib/swagger_docs_generator/metadata/tag.rb
swagger_docs_generator-0.2.0.pre.13 lib/swagger_docs_generator/metadata/tag.rb
swagger_docs_generator-0.2.0.pre.12 lib/swagger_docs_generator/metadata/tag.rb
swagger_docs_generator-0.2.0.pre.11 lib/swagger_docs_generator/metadata/tag.rb
swagger_docs_generator-0.2.0.pre.10 lib/swagger_docs_generator/metadata/tag.rb
swagger_docs_generator-0.2.0.pre.9 lib/swagger_docs_generator/metadata/tag.rb
swagger_docs_generator-0.1.2 lib/swagger_docs_generator/metadata/tag.rb