module OasRails::Extractors::RenderResponseExtractor

def build_schema_and_examples(content)

Returns:
  • (Array) - An array where the first element is the schema and the second is the examples.

Parameters:
  • content (String) -- The content extracted from the render call.
def build_schema_and_examples(content)
  if content.start_with?('{')
    [Utils.hash_to_json_schema(parse_hash_structure(content)), {}]
  else
    process_non_hash_content(content)
  end
rescue StandardError => e
  Rails.logger.debug("Error building schema: #{e.message}")
  [{}]
end