Sha256: 20d82a8b27fb3be9a71943d9f61d31ccdb35b34eee3fa253b24fb78b97caca05

Contents?: true

Size: 1.38 KB

Versions: 4

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

module Openapi3Parser
  module Node
    # This contains methods that are shared between nodes that act like a
    # Parameter, at the time of writing this was {Header}[../Header.html]
    # and {Parameter}[../Paramater.html]
    module ParameterLike
      # @return [String]
      def description
        node_data["description"]
      end

      # @return [String, nil]
      def description_html
        render_markdown(description)
      end

      # @return [Boolean]
      def required?
        node_data["required"]
      end

      # @return [Boolean]
      def deprecated?
        node_data["deprecated"]
      end

      # @return [Boolean]
      def allow_empty_value?
        node_data["allowEmptyValue"]
      end

      # @return [String, nil]
      def style
        node_data["style"]
      end

      # @return [Boolean]
      def explode?
        node_data["explode"]
      end

      # @return [Boolean]
      def allow_reserved?
        node_data["allowReserved"]
      end

      # @return [Schema, nil]
      def schema
        node_data["schema"]
      end

      # @return [Any]
      def example
        node_data["example"]
      end

      # @return [Map<String, Example>, nil]
      def examples
        node_data["examples"]
      end

      # @return [Map<String, MediaType>, nil]
      def content
        node_data["content"]
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
openapi3_parser-0.5.2 lib/openapi3_parser/node/parameter_like.rb
openapi3_parser-0.5.1 lib/openapi3_parser/node/parameter_like.rb
openapi3_parser-0.5.0 lib/openapi3_parser/node/parameter_like.rb
openapi3_parser-0.4.0 lib/openapi3_parser/node/parameter_like.rb