Sha256: 375bd930f914c2b3db7e6242684084f53ba17637d490cccbd69c38f5a32cce2f

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

# frozen_string_literal: true

require 'r2-oas/dynamic/schema/v3/object/from_routes/hookable_base_object'

module R2OAS
  module Schema
    module V3
      class InfoObject < R2OAS::Dynamic::Schema::V3::HookableBaseObject
        def to_doc
          execute_before_create
          create_doc
          execute_after_create
          doc
        end

        private

        def create_doc
          result = {
            'title' => 'OAS API Document Title',
            'description' => "This is a sample server Petstore server.  You can find out more about
            Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net,
            #swagger](http://swagger.io/irc/).  For this sample, you can use the api key
            `special-key` to test the authorization filters.",
            'termsOfService' => 'http://swagger.io/terms/',
            # Contact Object
            'contact' => {
              'name' => '',
              'url' => ''
            },
            # License Object
            'license' => {
              'name' => '',
              'url' => ''
            },
            'version' => '1.0.0'
          }
          doc.merge!(result)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
r2-oas-0.4.1 lib/r2-oas/schema/v3/object/from_routes/info_object.rb
r2-oas-0.4.0 lib/r2-oas/schema/v3/object/from_routes/info_object.rb