assert_correct_attributes: Assert that the API has returned the expected attributes

View source: R/helper-functions.R

assert_correct_attributesR Documentation

Assert that the API has returned the expected attributes

Description

The attributes returned by the API calls should be follow the API schema. This function compares received attributes against a vector of expected attributes, and returns an error if the two do not match. Unfortunately, there is no easy fix for this error: the package developer(s) must be notified, so that they can align the functions against the API schema.

Usage

assert_correct_attributes(received_attributes, expected_attributes)

Arguments

received_attributes

A character vector of attributes, in order.

expected_attributes

A character vector of expected attributes, in order.

Value

An error if the column names are not as expected.


ptvapi documentation built on May 29, 2024, 4:48 a.m.