Sha256: eb0c1adfbc304e70d83315945f178d2fea421cea48f8804e6a7c9408af6291d2

Contents?: true

Size: 675 Bytes

Versions: 4

Compression:

Stored size: 675 Bytes

Contents

require 'json'
require 'microsoft_kiota_abstractions'

module MicrosoftKiotaSerializationJson
  class JsonParseNodeFactory
    include MicrosoftKiotaAbstractions::ParseNodeFactory

    def get_valid_content_type
      'application/json'
    end

    def get_parse_node(content_type, content)
      if !content_type
        raise StandardError, 'content type cannot be undefined or empty'
      elsif get_valid_content_type != content_type
        raise StandardError, `expected a #{get_valid_content_type} content type`
      end
      raise StandardError, 'content cannot be undefined or empty' unless content

      JsonParseNode.new(JSON.parse(content))
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
microsoft_kiota_serialization_json-0.9.1 lib/microsoft_kiota_serialization_json/json_parse_node_factory.rb
microsoft_kiota_serialization_json-0.9.0 lib/microsoft_kiota_serialization_json/json_parse_node_factory.rb
microsoft_kiota_serialization_json-0.8.0 lib/microsoft_kiota_serialization_json/json_parse_node_factory.rb
microsoft_kiota_serialization_json-0.7.0 lib/microsoft_kiota_serialization_json/json_parse_node_factory.rb