Sha256: c33198c6903f18aeb8f4daade9c6e0e8542114ae4213b11aa0be0c25d89dc44b

Contents?: true

Size: 754 Bytes

Versions: 2

Compression:

Stored size: 754 Bytes

Contents

# frozen_string_literal: true

require "openapi3_parser/node/server"
require "openapi3_parser/node_factory/map"
require "openapi3_parser/node_factory/object"
require "openapi3_parser/node_factory/server_variable"

module Openapi3Parser
  module NodeFactory
    class Server < NodeFactory::Object
      allow_extensions
      field "url", input_type: String, required: true
      field "description", input_type: String
      field "variables", factory: :variables_factory

      private

      def build_object(data, context)
        Node::Server.new(data, context)
      end

      def variables_factory(context)
        NodeFactory::Map.new(
          context,
          value_factory: NodeFactory::ServerVariable
        )
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openapi3_parser-0.5.1 lib/openapi3_parser/node_factory/server.rb
openapi3_parser-0.5.0 lib/openapi3_parser/node_factory/server.rb