Sha256: 22d604dc2733440b56aa5b85c1e4c30071617c8645d27295496bf92293ab8e6f

Contents?: true

Size: 956 Bytes

Versions: 10

Compression:

Stored size: 956 Bytes

Contents

# frozen_string_literal: true

require "openapi3_parser/node_factory/object"

module Openapi3Parser
  module NodeFactory
    class Link < NodeFactory::Object
      allow_extensions

      # @todo The link object in OAS is pretty meaty and there's lot of scope
      # for further work here to make use of its functionality

      field "operationRef", input_type: String
      field "operationId", input_type: String
      field "parameters", factory: :parameters_factory
      field "requestBody"
      field "description", input_type: String
      field "server", factory: :server_factory

      mutually_exclusive "operationRef", "operationId", required: true

      private

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

      def parameters_factory(context)
        NodeFactory::Map.new(context)
      end

      def server_factory(context)
        NodeFactory::Server.new(context)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
openapi3_parser-0.9.2 lib/openapi3_parser/node_factory/link.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/openapi3_parser-0.9.1/lib/openapi3_parser/node_factory/link.rb
openapi3_parser-0.9.1 lib/openapi3_parser/node_factory/link.rb
openapi3_parser-0.9.0 lib/openapi3_parser/node_factory/link.rb
openapi3_parser-0.8.2 lib/openapi3_parser/node_factory/link.rb
openapi3_parser-0.8.1 lib/openapi3_parser/node_factory/link.rb
openapi3_parser-0.8.0 lib/openapi3_parser/node_factory/link.rb
openapi3_parser-0.7.0 lib/openapi3_parser/node_factory/link.rb
openapi3_parser-0.6.1 lib/openapi3_parser/node_factory/link.rb
openapi3_parser-0.6.0 lib/openapi3_parser/node_factory/link.rb