Module: GhostCrawl::KiotaParseNodeFix Private

Defined in:
lib/ghostcrawl/client.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#get_object_value(_factory) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/ghostcrawl/client.rb', line 146

def get_object_value(_factory)
  # The ghostcrawl SDK returns plain Ruby hashes and deliberately does NOT
  # rely on the generated typed response models (see the module comment and
  # ResponseHelper below). Several 200 schemas — notably scrape_result — model
  # their fields as composed anyOf members (identity_id, results, status,
  # format, markdown, ...). Kiota's Ruby json deserializer either raises
  # NoMethodError on those composed members (surfaced as the opaque
  # "Error during deserialization") OR the subsequent typed->serialize
  # round-trip in ResponseHelper drops the raw-hash field values, returning a
  # gutted body (e.g. scrape returning only {routing_mode, request_class} with
  # the whole `results`/`html` payload lost).
  #
  # @current_node is already the fully-parsed Ruby Hash/Array/primitive for
  # this node, so return it directly for every factory (callable typed models
  # included). ResponseHelper.to_hash then recurses it into a plain nested
  # Hash. Error responses are unaffected: Kiota applies the builder's
  # error_mapping (raising a typed ApiError) BEFORE the 2xx success factory
  # ever reaches this method.
  @current_node
rescue StandardError
  super
end