Skip to contents

This function is usually called by get_figma_file(), get_document_info() and get_figma_page(), to process the response object returned by the httr HTTP methods, such as httr::GET().

Usage

parse_response_object(response, .output_format, ...)

Arguments

response

The response object returned by the httr HTTP methods (e.g. httr::GET());

.output_format

A string with the name of the output format chosen by the user;

...

Further arguments passed by the caller;

Details

The functions from figma package adopts the philosophy to give, by default, the most raw and unprocessed result possible to the user. Because of it, parse_response_object() is usually called with .output_format = "response", which makes the function to just return the input as is.

This unprocessed and raw input gives all of the possible information to the user (which is good for debugging). But this information is usually in a very messy and not friendly format, which makes harder for data analysis and transformation pipelines.

The .output_format argument provide an option for the user to choose a more friendly format. As an example, with .output_format = "tibble", parse_response_object() will call figma::as_tibble() to parse the data of the response object, and fit it into a tibble::tibble() object.